SlideShare a Scribd company logo
2
Most read
6
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)

PPTX
Algorithm and pseudo codes
PPTX
Our presentation on algorithm design
PDF
SPL 2 | Algorithms, Pseudo-code, and Flowchart
PPTX
Algorithms and Flowcharts
PPTX
What is an algorithm?
PPTX
Programming Paradigm & Languages
PPT
High level and Low level Language
PPSX
Algorithm and flowchart
PPTX
Software Size Estimation
DOC
Notes of c programming 1st unit BCA I SEM
PPTX
Algorithm
PPTX
Introduction to programming
PPTX
Design and Analysis of Algorithms.pptx
PPTX
Programming Fundamentals lecture 1
PPTX
COMPILER DESIGN OPTIONS
PDF
software engineering
PPTX
Algorithm and flowchart
PPT
Algorithm Design Presentation
PPT
PPTX
Algorithm and Flowcharts
Algorithm and pseudo codes
Our presentation on algorithm design
SPL 2 | Algorithms, Pseudo-code, and Flowchart
Algorithms and Flowcharts
What is an algorithm?
Programming Paradigm & Languages
High level and Low level Language
Algorithm and flowchart
Software Size Estimation
Notes of c programming 1st unit BCA I SEM
Algorithm
Introduction to programming
Design and Analysis of Algorithms.pptx
Programming Fundamentals lecture 1
COMPILER DESIGN OPTIONS
software engineering
Algorithm and flowchart
Algorithm Design Presentation
Algorithm and Flowcharts
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
PPTX
INTROTOPROBLEMSOLVING.pptxINTROTOPROBLEMSOLVING.pptx
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
lecture 5
PPTX
Introduction to computer science
PPTX
Data Structures_Introduction to algorithms.pptx
PPS_Unit 1.pptx
Study Material for Problem Solving Techniques
INTROTOPROBLEMSOLVING.pptxINTROTOPROBLEMSOLVING.pptx
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
lecture 5
Introduction to computer science
Data Structures_Introduction to algorithms.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
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Business Ethics Teaching Materials for college
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Cell Structure & Organelles in detailed.
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
Institutional Correction lecture only . . .
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
master seminar digital applications in india
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Supply Chain Operations Speaking Notes -ICLT Program
O7-L3 Supply Chain Operations - ICLT Program
Anesthesia in Laparoscopic Surgery in India
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Business Ethics Teaching Materials for college
human mycosis Human fungal infections are called human mycosis..pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Cell Structure & Organelles in detailed.
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Institutional Correction lecture only . . .
TR - Agricultural Crops Production NC III.pdf
master seminar digital applications in india

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; }