QBasic Programming

WAP TO ENTER ANY DIGIT AND DISPLAY CUBE OF EVEN DIGITS

CLS
INPUT "ENTER ANY NUMBER"; N
PRINT "CUBE OF EVEN DIGITS ARE ";
WHILE N <> 0
R = N MOD 10
IF R MOD 2 = 0 THEN PRINT R ^ 3;
N = N \ 10
WEND
END
USING SUB PROCEDURE
DECLARE SUB EVEN (N)
CLS
INPUT "ENTER ANY NUMBER"; N
CALL EVEN (N)
END
SUB EVEN (N)
PRINT "SQUARE OF EVEN DIGITS ARE ";
WHILE N <> 0
R = N MOD 10
IF R MOD 2 = 0 THEN PRINT R ^ 3;
N = N \ 10
WEND
END SUB
USING FUNCTION PROCEDURE
DECLARE FUNCTION EVEN (N)
REM
CLS
INPUT "ENTER ANY NUMBER"; N
PRINT "CUBE OF EVEN DIGITS";
D = EVEN(N)
END
FUNCTION EVEN (N)
WHILE N <> 0
R = N MOD 10
IF R MOD 2 = 0 THEN PRINT R ^ 3;
N = N \ 10
WEND
END FUNCTION

WAP TO ENTER ANY DIGIT AND DISPLAY SQUARE OF ODD DIGITS (Prev Lesson)
(Next Lesson) WAP TO ENTER ANY DIGIT AND DISPLAY CUBE OF ODD DIGITS
Back to QBasic Programming
Notice: compact(): Undefined variable: limits in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

Notice: compact(): Undefined variable: groupby in /home/bhimgautam34/public_html/wp-includes/class-wp-comment-query.php on line 853

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!