QBasic Programming

WAP to display all natural numbers from 1 to 100 also display its sum

DECLARE SUB SERIES ( )
CLS
CALL SERIES
END : SUB SERIES
FOR I = 1 TO 100
PRINT I,
S = S + I
NEXT I
PRINT “SUM OF ALL NATURAL NUMBERS FROM 1 TO 100=”; S
END SUB

WAP to display all even numbers from 2 to 100 in descending order (Prev Lesson)
(Next Lesson) WAP to display all odd numbers from 1 to 100 also display its sum
Back to QBasic Programming

No Comments

Post a Reply

Course Curriculum

error: Content is protected !!