Algorithms and Flowchart
Algorithms
- A sequential solution of any program that written in human language,called algorithm.
- Algorithm is first step of the solution process, after the analysis of problem, programmer write the algorithm of that problem.
- Example of Algorithms:
Q. Write a algorithem to find out number is odd or even?
Ans.
step 1 : start
step 2 : input number
step 3 : rem=number mod 2
step 4 : if rem=0 then
print "number even"
else
print "number odd"
endif
step 5 : stop
Flowchart
1. Graphical representation of any program is called flowchart.
2. There are some standard graphics that are used in flowchart as following:
Figure: Start/Stop terminal box |
Figure: Input/Output box |
Figure: Process/Instruction box |
Figure: Lines or Arrows |
Figure: Decision box |
Figure: Connector box |
Figure: Comment box |
Figure: Preparation box |
Figure: Separate box |
Q. Make a flowchart to input temperature, if temperature is less than 32 then print "below freezing" otherwise print "above freezing"?
Ans.
Figure: Flowchart example of C program |
Related programs:
- Flowchart for search prime number
- Factorial C program, Algorithm and Flowchart
- Flowchart for finding Armstrong number
- Rules for constructing an Algorithm
- if, if...else, nested if...else, if...else if - statement and flowchart
- Algorithm for rectangle number pattern
- Algorithm for star pyramid
- Draw a flowchart, and write algorithm and C program for calculate sum of square
Using creately flowchart software you can draw beautiful diagrams like the diagrams in creately community.
ReplyDelete