Computer Science, asked by adharmamai, 1 month ago

Write a program to display even numbers from 21 to 100 qbasic​

Answers

Answered by saloniashelar2903
4

Answer:

I have solve 1 to 100 all types like natural number..odd number..even number..prime number..all

Explanation:

.   WAP to display all natural numbers from 1 to 100.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 1 TO 100

PRINT I,

NEXT I

END SUB

 WAP to display all odd numbers from 1 to 100.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 1 TO 100 STEP 2

PRINT I,

NEXT I

END SUB

 WAP to display all even numbers from 2 to 100.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 2 TO 100 STEP 2

PRINT I,

NEXT I

END SUB

 WAP to find the sum of all natural numbers from 1 to 100.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 1 TO 100

S = S + I

NEXT I

PRINT “SUM OF ALL NATURAL NUMBERS FROM 1 TO 100=”; S

END SUB

WAP to find the sum of all odd numbers from 1 to 100.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 1 TO 100 STEP 2

S = S + I

NEXT I

PRINT “SUM OF ALL ODD NUMBERS FROM 1 TO 100=”; S

END SUB

 WAP to find the sum of all even numbers from 2 to 100.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 2 TO 100 STEP 2

S = S + I

NEXT I

PRINT “SUM OF ALL NATURAL NUMBERS FROM 1 TO 100=”; S

END SUB

WAP to display all natural numbers from 1 to 100 in descending order.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 100 TO 1 STEP - 1

PRINT I,

NEXT I

END SUB

 WAP to display all odd numbers from 1 to 100 in descending order.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 99 TO 1 STEP - 2

PRINT I,

NEXT I

END SUB

WAP to display all even numbers from 2 to 100 in descending order.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 100 TO 2 STEP - 1

PRINT I,

NEXT I

END SUB

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 odd numbers from 1 to 100 also display its sum.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 1 TO 100 STEP 2

PRINT I,

S = S + I

NEXT I

PRINT “SUM OF ALL ODD NUMBERS FROM 1 TO 100=”; S

END SUB

 WAP to display all even numbers from 2 to 100 also display its sum.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 2 TO 100 STEP 2

PRINT I,

S = S + I

NEXT I

PRINT “SUM OF ALL EVEN NUMBERS FROM 1 TO 100=”; S

END SUB

WAP to display cube of all numbers from 1 to 50.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 1 TO 50

PRINT I ^ 3,

NEXT I

END SUB

 WAP to display square of all numbers from 1 to 50.

DECLARE SUB SERIES ( )

CLS

CALL SERIES

END

SUB SERIES

FOR I = 1 TO 50

PRINT I ^ 2,

Similar questions