Thursday, August 13, 2020

                    ALGORITHM 

             ---------------------------


1.WRITE AN ALGORITHM TO INPUT 2 NUMBERS AND DISPLAY THE LARGEST NUMBER .


ANSWER :

 START

STEP 1: DECLARE THE VARIABLES X AND Y AS INTEGER.

STEP 2: INPUT THE VALUES OF X  AND Y .

STEP3 : IF X=Y THEN PRINT "BOTH ARE EQUAL", GO TO END

STEP 4 IF X>Y THEN PRINT X,"IS LARGEST" ELSE PRINT Y,"IS LARGEST"

END


No comments:

Post a Comment

  3.WAP IN JAVA TO INPUT THREE NUMBERS AND COUNT HOW MANY OF THEM ARE EVEN .   import java.util.*; class Prog {   public static ...