UNIT 1 Problem solving with computer
UNIT 1 Problem solving with computer
Step 3 − Calculate c = a + b
Step 4 − Display c
Step 5 − STOP
Problem 2 - Design an algorithm to input principal, time and rate and
display the interest.
Problem 3 - Design an algorithm to find largest number among three
numbers.
Problem 4 - Design an algorithm to find sum and average of first n
natural numbers.
Flowchart:
• A flowchart in C language is a graphical representation of an
algorithm.
• Flowchart in C is a diagrammatic representation of a sequence of
logical steps of a program.
• Flowcharts use simple geometric shapes to depict processes and
arrows to show relationships and process/data flow.
Advantages of Flowchart in C:
1. Communication: A flowchart is a better way of communicating the
logic of a program.
2. Efficient Coding: Flowcharts act as a guide for a programmer in
writing the actual code in a high-level language.
3. Proper Debugging: Flowcharts help in the debugging process.
4. Effective Analysis: Effective analysis of logical programs can be
easily done with the help of a related flowchart.
5. Testing: A flowchart helps in the testing process.
Disadvantages of Flowchart in C:
1. Time-consuming: Designing a flowchart is a very time-consuming
process.
2. Complex: It isn't easy to draw a flowchart for large and complex
programs.
3. Difficult to modify: It is very difficult to modify the existing
flowchart.
1. Draw a flowchart to add two numbers:
2. Draw a flowchart to input principal, time and rate and display
interest.
3. Draw a flowchart to find largest among three numbers.
4. Draw a flowchart to find sum of n natural numbers.
F
THANK YOU FOR YOUR ATTENTION