QBasic Programming

Input days and convert into years, months and days

REM PROGRAM TO INPUT DAYS AND CONVERT INTO YEARS, MONTHS AND DAYS
CLS
INPUT “ENTER DAYS”; D
Y = D \ 365
MO = D MOD 365
M = MO \ 30
D = MO MOD 30
PRINT Y; “YEARS ” ; M; “MONTHS”; D; “DAYS”
END
USING SUB PROCEDURE
DECLARE SUB CONVERT(D)
CLS
INPUT “ENTER DAYS”; D
CALL CONVERT(D)
END
SUB CONVERT (D)
Y = D \ 365
MO = D MOD 365
M = MO \ 30
D = MO MOD 30
PRINT Y; “YEARS ” ; M; “MONTHS”; D; “DAYS”
END SUB
USING FUNCTION PROCEDURE
DECLARE FUNCTION CONVERT(D)
COMMON SHARED Y, M
CLS
INPUT “ENTER DAYS”; D
DD = CONVERT (D)
PRINT Y; “YEARS ” ; M; “MONTHS”; DD; “DAYS”
END
FUNCTION CONVERT (D)
Y = D \ 365
MO = D MOD 365
M = MO \ 30
D S= MO MOD 30
CONVERT = DS
END FUNCTION

Input number as paise and convert into rupees only (Prev Lesson)
(Next Lesson) Input seconds and convert into hours minutes and seconds
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 !!