SlideShare a Scribd company logo
2
Most read
3
Most read
16
Most read
Problem solving usingProblem solving using
ComputersComputers
By :
David Livingston J
Sudesh Kantila
Need for Programming LanguageNeed for Programming Language
1. We have some problem.
2. We have to solve the problem.
3. We can solve the problem, but we don’t
want to repeatedly solve the similar
problems.
4. We want to use the computer to do this
task for us whenever required.
5. We have to tell the computer, “How to
solve the problem.”
What is Problem?What is Problem?
 A problem is an obstacle which makes it
difficult to achieve a desired goal, objective
or purpose.
 It refers to a situation, condition, or issue
that is yet unresolved.
 In a broad sense, a problem exists when
an individual becomes aware of a
significant difference between what
actually is and what is desired.
What is Problem Solving?What is Problem Solving?
Every problem in the real world needs to
be identified and solved. Trying to find a
solution to a problem is known as
problem solving.
Problem solving becomes a part of our
day to day activity. Especially, when we
use computers for performing our day to
day activity.
How to solve a problem?How to solve a problem?
1. If you have a problem, either you can solve it
manually or using computer.
2. If the problem is easy enough, solve it
manually or else use computers.
3. Bigger problems can be sub-divided into
smaller problems (sub-problems) and start
solving them one by one.
4. After completing solving sub-problems, the
entire big problem has been solved easily.
Algorithm – Logic to solveAlgorithm – Logic to solve
If you have solved any problem already,
you would have definitely used some
procedure (logic) to do so.
There may be many different logic that can
solve a single problem.
You may write this logic into small steps
(easy enough) in english (or whatever
language you understand).
This block of steps to solve the problem is
called an “Algorithm”.
A simple problem - FactorialA simple problem - Factorial
We have to calculate the factorial of a
number ‘N’.
We know how to calculate the factorial.
Logic 1:
N! = N * N-1 * N-2 * …* N-(N-1) {N-(N-1)=1}
Logic 2:
N! = 1 * 2 * 3 * … * N
Logic 3:
N! = N * (N-1)! (Recursion)
Logic 1: (Algorithm)Logic 1: (Algorithm)
1. START
2. INPUT AN INTEGER – N
3. LET F=1
4. IF N > 1 GOTO STEP 5 ELSE STEP 8
5. F = F * N
6. N = N – 1
7. GOTO STEP 4
8. OUTPUT F
9. STOP
Logic 2: (Algorithm)Logic 2: (Algorithm)
1. START
2. INPUT AN INTEGER – N
3. LET F=1, X=1
4. IF X < N GOTO STEP 5 ELSE STEP 8
5. X = X + 1
6. F = F * X
7. GOTO STEP 4
8. OUTPUT F
9. STOP
Flow Chart – Graphical AlgorithmFlow Chart – Graphical Algorithm
Algorithms are written in some natural
language, e.g. – English, िहिन्दी, Chinease etc.
There may be some problem to understand
the algorithm if a person from different
region speaking a different language needs to
know the logic.
To overcome this problem, logic may be
represented in a graphical way.
This graphical representation of algorithm is
called ‘Flow Chart’
Flow Chart – Logic 1Flow Chart – Logic 1
LET F=1
IF
N > 1
INPUT N
START
OUTPUT F
START
F = F * N
N = N - 1
Yes
No
Flow Chart – Logic 2Flow Chart – Logic 2
LET F=1
X = 1
IF
X < N
INPUT N
START
OUTPUT F
START
X = X + 1
F = F * X
No
Yes
Common Flow Chart ShapesCommon Flow Chart Shapes
Flow Lines
Terminator
Input / Output Box
Process
Decision Box
(On Page and Off Page) Connectors
Predefined Process
PseudocodePseudocode
Pseudocode is a kind of structured english for
describing algorithms.
It allows the designer to focus on the logic of the
algorithm without being distracted by details of
language syntax. 
At the same time, the pseudocode needs to be
complete. It describe the entire logic of the
algorithm so that implementation becomes a rote
mechanical task of translating line by line into
source code (coding).
Pseudocode cannot be compiled nor executed, and
there are no real formatting or syntax rules.
Pseudocode – Logic 1Pseudocode – Logic 1
GET value of N
SET initial value of F to 1
WHILE N > 1
F = F * N
N = N – 1
ENDWHILE
DISPLAY value of F
Programming (Coding) in CProgramming (Coding) in C
main()
{
int n;
long f=1;
printf(“Input n to get factorial: ”);
scanf(“%i”,&n);
while (n > 1)
{
f = f * n;
n = n – 1;
}
printf(“Factorial of %i is %li”,n,f);
retrun 0;
}

More Related Content

PPTX
Flowchart and algorithm
PPTX
Chapter 6 algorithms and flow charts
PPTX
Algorithms and flowcharts
PDF
Unit 1-problem solving with algorithm
PPTX
Unit 1. Problem Solving with Computer
PPT
3 algorithm-and-flowchart
PPTX
Algorithm and flowchart
PPT
8.2 approach in problem solving (9 hour)
Flowchart and algorithm
Chapter 6 algorithms and flow charts
Algorithms and flowcharts
Unit 1-problem solving with algorithm
Unit 1. Problem Solving with Computer
3 algorithm-and-flowchart
Algorithm and flowchart
8.2 approach in problem solving (9 hour)

What's hot (20)

PPT
Lecture 1 - Lexical Analysis.ppt
PPTX
Process synchronization in Operating Systems
PPT
Operating system services 9
PPT
Introduction to Compiler design
PPTX
cpu scheduling
PPT
Algorithm Design Presentation
PPTX
Bruteforce algorithm
PPTX
What is programming what are its benefits
PPTX
Algorithm Introduction
PPTX
Programming Fundamentals
PDF
Algorithm defination, design & Implementation
PPTX
Threads (operating System)
PPT
4 evolution-of-programming-languages
PDF
Design and analysis of algorithms
PPTX
RECURSIVE DESCENT PARSING
PPTX
8 queen problem
PPTX
Cpu scheduling in operating System.
PDF
OS - Process Concepts
PPTX
Recognition-of-tokens
PPTX
Cohesion and coupling
Lecture 1 - Lexical Analysis.ppt
Process synchronization in Operating Systems
Operating system services 9
Introduction to Compiler design
cpu scheduling
Algorithm Design Presentation
Bruteforce algorithm
What is programming what are its benefits
Algorithm Introduction
Programming Fundamentals
Algorithm defination, design & Implementation
Threads (operating System)
4 evolution-of-programming-languages
Design and analysis of algorithms
RECURSIVE DESCENT PARSING
8 queen problem
Cpu scheduling in operating System.
OS - Process Concepts
Recognition-of-tokens
Cohesion and coupling
Ad

Viewers also liked (20)

PPT
Data structures & problem solving unit 1 ppt
PPS
Power Point Lesson 06
PPT
Chapter 02 - Problem Solving
PPTX
Problems, Opportunities and Decisions
PDF
Sigma Knowledge Engineering Environment
PDF
Introduction to Object Oriented Design
PPT
Slide 3 musfique
PDF
Object Oriented Design And Programing
PPTX
Unit 2. Elements of C
PPSX
Thinking and language
PPT
3.o o design -_____________lecture 3
PPTX
Out of the box thinking
PPTX
Problem solving section 1
PPT
Solving a “Transportation Planning” Problem through the Programming Language “C”
PPT
Mypresentation
PDF
4 Solving problem
DOCX
Structured systems analysis and design methodology
PPSX
FINITE STATE MACHINE AND CHOMSKY HIERARCHY
PDF
Visualization of Hajime Yoshino’s Logical Jurisprudence. IRIS 2017
PDF
Machine Learning for Automated Reasoning: An Overview
Data structures & problem solving unit 1 ppt
Power Point Lesson 06
Chapter 02 - Problem Solving
Problems, Opportunities and Decisions
Sigma Knowledge Engineering Environment
Introduction to Object Oriented Design
Slide 3 musfique
Object Oriented Design And Programing
Unit 2. Elements of C
Thinking and language
3.o o design -_____________lecture 3
Out of the box thinking
Problem solving section 1
Solving a “Transportation Planning” Problem through the Programming Language “C”
Mypresentation
4 Solving problem
Structured systems analysis and design methodology
FINITE STATE MACHINE AND CHOMSKY HIERARCHY
Visualization of Hajime Yoshino’s Logical Jurisprudence. IRIS 2017
Machine Learning for Automated Reasoning: An Overview
Ad

Similar to Problem solving using Computer (20)

PPTX
PPS_Unit 1.pptx
PDF
Study Material for Problem Solving Techniques
PPT
Unit 1 python (2021 r)
PPTX
Lec-ProblemSolving.pptx
PDF
Algorithm.pdf
PPTX
s-INTRODUCTION TO PROBLEM SOLVING PPT.pptx
PDF
Algorithmic problem sloving
PPSX
CC-112-Lec.1.ppsx
PDF
Problem solving methodology
PPTX
Introduction to problem solving Techniques
PPTX
Module 1 python.pptx
PPT
programming language(C++) chapter-one contd.ppt
PPTX
Algorithm and flowchart with pseudo code
PPTX
Computational Thinking CBSE Class-XI
PDF
Logic Development and Algorithm.
PPTX
Algorithm for computational problematic sit
PPTX
Introduction to computer science
PPTX
lecture 5
PPTX
Data Structures_Introduction to algorithms.pptx
PPTX
Lesson 1 of c programming algorithms and flowcharts.pptx
PPS_Unit 1.pptx
Study Material for Problem Solving Techniques
Unit 1 python (2021 r)
Lec-ProblemSolving.pptx
Algorithm.pdf
s-INTRODUCTION TO PROBLEM SOLVING PPT.pptx
Algorithmic problem sloving
CC-112-Lec.1.ppsx
Problem solving methodology
Introduction to problem solving Techniques
Module 1 python.pptx
programming language(C++) chapter-one contd.ppt
Algorithm and flowchart with pseudo code
Computational Thinking CBSE Class-XI
Logic Development and Algorithm.
Algorithm for computational problematic sit
Introduction to computer science
lecture 5
Data Structures_Introduction to algorithms.pptx
Lesson 1 of c programming algorithms and flowcharts.pptx

More from David Livingston J (9)

PPTX
Performing Addition and Subtraction on Integers
PPT
Introduction to Bluetooth technology
PPT
Wireless LAN Technoloy
PPT
Past, Present and Future of Mobile Computing
PPT
Introduction & history of mobile computing
PPT
Frequently asked questions in c
PPT
Frequently asked questions in c
PPT
File handling in c
PPT
Structure of a C program
Performing Addition and Subtraction on Integers
Introduction to Bluetooth technology
Wireless LAN Technoloy
Past, Present and Future of Mobile Computing
Introduction & history of mobile computing
Frequently asked questions in c
Frequently asked questions in c
File handling in c
Structure of a C program

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
PPTX
Introduction and Scope of Bichemistry.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
PSYCHOLOGY IN EDUCATION.pdf ( nice pdf ...)
PPTX
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
PDF
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Business Ethics Teaching Materials for college
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Cardiovascular Pharmacology for pharmacy students.pptx
Introduction and Scope of Bichemistry.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PSYCHOLOGY IN EDUCATION.pdf ( nice pdf ...)
UNDER FIVE CLINICS OR WELL BABY CLINICS.pptx
How to Manage Starshipit in Odoo 18 - Odoo Slides
Piense y hagase Rico - Napoleon Hill Ccesa007.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
Mga Unang Hakbang Tungo Sa Tao by Joe Vibar Nero.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Business Ethics Teaching Materials for college
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
NOI Hackathon - Summer Edition - GreenThumber.pptx
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf

Problem solving using Computer

  • 1. Problem solving usingProblem solving using ComputersComputers By : David Livingston J Sudesh Kantila
  • 2. Need for Programming LanguageNeed for Programming Language 1. We have some problem. 2. We have to solve the problem. 3. We can solve the problem, but we don’t want to repeatedly solve the similar problems. 4. We want to use the computer to do this task for us whenever required. 5. We have to tell the computer, “How to solve the problem.”
  • 3. What is Problem?What is Problem?  A problem is an obstacle which makes it difficult to achieve a desired goal, objective or purpose.  It refers to a situation, condition, or issue that is yet unresolved.  In a broad sense, a problem exists when an individual becomes aware of a significant difference between what actually is and what is desired.
  • 4. What is Problem Solving?What is Problem Solving? Every problem in the real world needs to be identified and solved. Trying to find a solution to a problem is known as problem solving. Problem solving becomes a part of our day to day activity. Especially, when we use computers for performing our day to day activity.
  • 5. How to solve a problem?How to solve a problem? 1. If you have a problem, either you can solve it manually or using computer. 2. If the problem is easy enough, solve it manually or else use computers. 3. Bigger problems can be sub-divided into smaller problems (sub-problems) and start solving them one by one. 4. After completing solving sub-problems, the entire big problem has been solved easily.
  • 6. Algorithm – Logic to solveAlgorithm – Logic to solve If you have solved any problem already, you would have definitely used some procedure (logic) to do so. There may be many different logic that can solve a single problem. You may write this logic into small steps (easy enough) in english (or whatever language you understand). This block of steps to solve the problem is called an “Algorithm”.
  • 7. A simple problem - FactorialA simple problem - Factorial We have to calculate the factorial of a number ‘N’. We know how to calculate the factorial. Logic 1: N! = N * N-1 * N-2 * …* N-(N-1) {N-(N-1)=1} Logic 2: N! = 1 * 2 * 3 * … * N Logic 3: N! = N * (N-1)! (Recursion)
  • 8. Logic 1: (Algorithm)Logic 1: (Algorithm) 1. START 2. INPUT AN INTEGER – N 3. LET F=1 4. IF N > 1 GOTO STEP 5 ELSE STEP 8 5. F = F * N 6. N = N – 1 7. GOTO STEP 4 8. OUTPUT F 9. STOP
  • 9. Logic 2: (Algorithm)Logic 2: (Algorithm) 1. START 2. INPUT AN INTEGER – N 3. LET F=1, X=1 4. IF X < N GOTO STEP 5 ELSE STEP 8 5. X = X + 1 6. F = F * X 7. GOTO STEP 4 8. OUTPUT F 9. STOP
  • 10. Flow Chart – Graphical AlgorithmFlow Chart – Graphical Algorithm Algorithms are written in some natural language, e.g. – English, िहिन्दी, Chinease etc. There may be some problem to understand the algorithm if a person from different region speaking a different language needs to know the logic. To overcome this problem, logic may be represented in a graphical way. This graphical representation of algorithm is called ‘Flow Chart’
  • 11. Flow Chart – Logic 1Flow Chart – Logic 1 LET F=1 IF N > 1 INPUT N START OUTPUT F START F = F * N N = N - 1 Yes No
  • 12. Flow Chart – Logic 2Flow Chart – Logic 2 LET F=1 X = 1 IF X < N INPUT N START OUTPUT F START X = X + 1 F = F * X No Yes
  • 13. Common Flow Chart ShapesCommon Flow Chart Shapes Flow Lines Terminator Input / Output Box Process Decision Box (On Page and Off Page) Connectors Predefined Process
  • 14. PseudocodePseudocode Pseudocode is a kind of structured english for describing algorithms. It allows the designer to focus on the logic of the algorithm without being distracted by details of language syntax.  At the same time, the pseudocode needs to be complete. It describe the entire logic of the algorithm so that implementation becomes a rote mechanical task of translating line by line into source code (coding). Pseudocode cannot be compiled nor executed, and there are no real formatting or syntax rules.
  • 15. Pseudocode – Logic 1Pseudocode – Logic 1 GET value of N SET initial value of F to 1 WHILE N > 1 F = F * N N = N – 1 ENDWHILE DISPLAY value of F
  • 16. Programming (Coding) in CProgramming (Coding) in C main() { int n; long f=1; printf(“Input n to get factorial: ”); scanf(“%i”,&n); while (n > 1) { f = f * n; n = n – 1; } printf(“Factorial of %i is %li”,n,f); retrun 0; }