GfG QA is closing soon... Please refer PRACTICE or GfG now on wards !!

I started programming less than week ago and i need a little help finding the issue in this pseudo-code i wrote.

Obtain two numbers from the keyboard. Then determine and display which (if either) is the larger of the two numbers.


          DECLARE num1, num2, largest as INTEGER

          PRINT "Enter num1"

          READ num1

          PRINT "Enter num2"

          READ num2

          IF num1 > num2 THEN

             largest = num1


              largest = num2


              IF num1 == num2 THEN

                   PRINT "Error, both numbers are the same"




asked Jan 30, 2017 by Sanjay Williams

1 Answer

Start Declare no.1 and no.2 and large Print and read both no's from keyboard. If(no.1>no.2) Large=no.1 Else if(no.2>no.1) Large=no.2 Else Print both are same
answered Feb 1, 2017 by arunamokara