# ALGORITHMS AND FLOWCHARTS

Fill in the blanks: 1. Algorithms and flowcharts are two methods used to analyze a problem step by step. 2. The terminal symbol is used to indicate the beginning or end of a flowchart. 3. The direction of flow in a flowchart is from top to bottom or from left to right. . The connector symbol is used to indicate a junction point in a flowchart. !. A group of statements that are to be repeated a number of times is known as a loop. Ans"e# the \$%ll%"in& '(esti%ns: 1. What is an algorithm? An algorithm is the set of rules that define how a particular problem can be solved in a finite number of well-defined steps. 2. What is a flowchart? A flowchart is a diagrammatic representation of the problem-solving process in which decision steps are laid out in a logical order. 3. Write any four advantages of flowcharts and algorithms. o They are simple to understand. o They provide a step-by-step solution for a problem. o The logic of the problem can be easily tested and debugging is simple. o They do not depend on any of the programming languages.

. "tep #. "tep #. A8(\$A9( ) : "tep '. !raw a flowchart for the same task.\$3!45T ) 6 * 7 "tep 2.(\$-. . . "tep >.\$3!45T ). Write an algorithm to accept two numbers and find their product. -f 534. 5ompare 534. \$ead a value in .\$3!45T ) # "tep '.T and #:. !raw a flowchart for the same.rint .(T(\$ !. \$ead % and & "tep '.4. "4. "4. Write an algorithm to find the area and perimeter of a rectangle if the length and breadth of the rectangle are given.T0# "tep =. "tep ?.. A #: "tep #:. 0 . ) "4.T is less than #: repeat steps 2 to > "tep @. "et . . \$ead 6 and 7 "tep +. ) : "tep +.(T(\$ ) '*/%0&1 "tep 2.T ) : "tep 2. A\$(A ) %*& "tep +.rint A8(\$A9( . 534. "tep #. "tep <.rint A\$(A . 534. . Write an algorithm and draw the flowchart to find the average of ten given numbers.4.(\$-. A8(\$A9( ) "4.T ) 534.

) : A8(\$A9( ) : 534.T ) 534."tart "4.T B #:? .o A8(\$A9( ) "4. 0 . A #: . 7es 534. ) "4. -s 534.4.T ) : \$ead .T 0 # "4.4.rint A8(\$A9( "top .

) :? 7es . !raw a flowchart to accept a number and display whether it is a positive number or a negative number or zero.o 7es -s .3"-T-8( .o .o -s .4.4.rint . .rint C(\$3 . "tart \$ead .rint .*. D :? .4.(9AT-8( "top .

' 0 .+ . "tart T3TA% ) : . !raw a flowchart to accept marks obtained in three subjects by a student and display the total marks and the percentage.(\$5(.# .rint T3TA% .TA9( "top .(\$5(.+ T3TA% ) .+.# 0 .(\$5(.' .TA9( ) : \$ead .TA9( ) /T3TA%A+::1 * #:: .

o -s & D 5 ? .rint 5 7es . "tart \$ead A & 5 -s A D & ? 7es -s A D 5? 7es .@.rint & "top ********* . !raw a flowchart to find the largest among three given numbers.o .o .rint A .