Basic Program To Tell the Given Number is Even or Odd

REM THE PROG TELLS IF THE GIVEN NUMBER IS EVEN OR ODD. TAKE THE NUMBER
REM DIVIDE IT BY TWO. REMAINDER IS EITHER 0 OR 1.ONCE AGAIN Q TIMES 2
REM SHOULD BE REMOVED FROM NUMBER. IF REMAINDER IS ONE THEN IT IS ODD AS
REM IT IS NOT FULLY DIVISIBLE BY 2
CLS
10 INPUT ” ENTER THE NUMBER”; N
20 FOR I = 1 TO INT(N / 2)
30 N = N – 2
40 NEXT I
50 IF N = 1 THEN PRINT “THE GIVEN NUMBER IS ODD” ELSE PRINT “THE NUMBER IS EVEN”
60 END

Please follow and like us:

Leave a comment