General Knowledge
Basic General Knowledge
Subjective
Mar 19, 2013
Modify the program you wrote for program six, to accept three values, A B C, and print the largest value.
Detailed Explanation
program prog7 ( input, output );
var A, B, C : integer;
begin
writeln('Please enter three numbers seperated by spaces');
readln( A, B, C );
if A >= B then
begin
if A >= C then writeln( A,' is the largest')
else writeln( C,' is largest')
end
else
if B >= C then writeln( B,' is the largest')
else writeln( C,' is the largest')
end.
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts