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

Ask a Question

 

Start Coding Today

   

GeeksQuiz

GeeksforGeeksIDE

Data Structures

Algorithms

Interview Experiences

C Programming

C++ Programming

Java Programming

GATE CS

Books

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.

START

          DECLARE num1, num2, largest as INTEGER

          PRINT "Enter num1"

          READ num1

          PRINT "Enter num2"

          READ num2

          IF num1 > num2 THEN

             largest = num1

              Else

              largest = num2

              ELSE

              IF num1 == num2 THEN

                   PRINT "Error, both numbers are the same"

              ENDIF

          ENDIF

STOP

asked Jan 30 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 by arunamokara
...