General Knowledge Basic General Knowledge Subjective
Mar 19, 2013

Write a program which inputs two values, call them A and B. Print the value of the largest variable.

Detailed Explanation

program prog6 ( input, output );
var value1, value2 : integer;
begin
    writeln('Please enter two numbers seperated by a space');
    readln( value1, value2 );
    if value1 > value2 then
    writeln( value1,' is greater than', value2 )
    else
    if value1 = value2 then
    writeln( value1, ' is the same as ', value2 )
    else
    writeln( value2, ' is greater than ', value1 )
end.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback