Question
Draw flowchart, write pseudocode and Pascal program for the problem of finding the smallest number of 10 numbers.
Answer
Flowchart
Pseudocode Start input number N Min=N Count=1 While Count <10 Input number N if N < Min Min=N endif Count=Count + 1 end while print Min end
Pascal Program
Program fimdsmallest; var N:Integer; Count:integer; Min:integer; begin write('Enter a Number ?'); readln(N); Count:=1; Min:=N; while Count < 10 do begin write('Enter a Number ?'); readln(N); if N < Min then Min:=N; Count:=Count+1; end; write('Minimum Number is :') ; writeln(Min); readln; end.
thank you very much
ReplyDelete