QBasic Programming

WAP to input any number and check whether the given no. is divisible by 5 or not

REM
CLS
INPUT “ENTER ANY NUMBER”; N
IF N MOD 5 = 0 THEN
PRINT N; "IS DIVISIBLE BY 5”
ELSE
PRINT N; "IS NOT DIVISIBLE BY 5”
END IF
END
USING SUB PROCEDURE
DECLARE SUB CHECK (N)
CLS
INPUT “ENTER ANY NUMBER”; N
CALL CHECK (N)
END
SUB CHECK (N)
IF N MOD 5 = 0 THEN
PRINT N; "IS DIVISIBLE BY 5”
ELSE
PRINT N; "IS NOT DIVISIBLE BY 5”
END IF
END SUB
USING FUNCTION PROCEDURE
DECLARE FUNCTION CHECK$ (N)
CLS
INPUT “ENTER ANY NUMBER”; N
PRINT N; “IS “; CHECK$(N) ; “BY 5”
END
FUNCTION CHECK$ (N)
IF N MOD 5 = 0 THEN
CHECK$ = “DIVISIBLE”
ELSE
CHECK$ = “NOT DIVISIBLE”
END IF : END FUNCTION

Solve a quadratic equation ax2+bx+c=0 on the basis of the coefficient values a, b, and c (Prev Lesson)
(Next Lesson) WAP to input any number and check whether the given no. is divisible by 3 and 7 or not
Back to QBasic Programming

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!