ALGORITHM
---------------------------
2.WRITE AN ALGORITHM TO INPUT 3 NUMBERS , DISPLAY ONLY THOSE NUMBERS WHICH ARE DIVISIBLE BY 8 .
START
STEP 1: DECLARE THE VARIABLES X,Y AND Z AS INTEGER.
STEP 2: IF X % 8 = 0 THEN PRINT X,"IS DIVISIBLE BY 8" ('%' IS USED TO RETURN THE REMAINDER IN CASE OF DIVISION)
STEP 3: IF Y % 8 = 0 THEN PRINT Y,"IS DIVISIBLE BY 8"
STEP 4: IF Z % 8 = 0 THEN PRINT Z,"IS DIVISIBLE BY 8"
END
No comments:
Post a Comment