QBasic Programming

WAP to convert decimal number to octal number

CLS
INPUT "ENTER DECIMAL NUMBER"; D
WHILE D  < > 0
R = D MOD 8
S$ = STR$(R) + S$
D = D \ 8
WEND
PRINT "OCTAL EQUIVALENT VALUE="; S$
END
USING SUB PROCEDURE
DECLARE SUB CONV(D)
CLS
INPUT "ENTER DECIMAL NUMBER"; D
CALL CONV(D)
END
SUB CONV(D)
WHILE D  < > 0
R = D MOD 8
S$ = STR$(R) + S$
D = D \ 8
WEND
PRINT "OCTAL EQUIVALENT VALUE="; S$
END
USING FUNCTION PROCEDURE
DECLARE SUB CONV$(D)
CLS
INPUT "ENTER DECIMAL NUMBER"; D
PRINT "OCTAL EQUIVALENT VALUE=";  CONV$(D)
END
SUB CONV$(D)
WHILE D  < > 0
R = D MOD 8
S$ = STR$(R) + S$
D = D \ 8
WEND
CONV$ = S$
END FUNCTION

WAP to convert binary number to decimal number (Prev Lesson)
(Next Lesson) WAP to convert octal number to decimal number
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 !!