1.WRITE AN ALGORITHM TO INPUT 100 NUMBERS AND DISPLAY THE SUM OF ODD NUMBERS
START
STEP 1 : DECLARE I , C , NUM AS AN INTEGER
STEP 2: I=1 , C=0 , NUM=0
STEP 3: INPUT "ENTER THE NUMBER", NUM
STEP 4: IF NUM %2< >0 THEN C=C+NUM
STEP 5: INCREMENT THE VALUE OF I BY 1
STEP 6: IF I<=100 THEN GOTO STEP 3
STEP 7 : PRINT "SUM OF ODD NUMBERS", C
END
No comments:
Post a Comment