Thursday, August 13, 2020

                                  ALGORITHM

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

 3.WRITE AN ALGORITHM TO INPUT A NUMBER AND CHECK WHETHER THE NUMBER IS ODD OR EVEN.


START

STEP 1: DECLARE THE VARIABLE X AS INTEGER.

STEP2: INPUT THE VALUE OF X

STEP 3: IF X% 2=0 THEN PRINT X,"IS EVEN" ELSE PRINT X,"IS ODD" ('%' IS USED TO RETURN THE REMAINDER IN CASE OF DIVISION)

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 ...