Computer Science, asked by aryanapejay, 3 months ago

WAP to print following series:
a) 9 7 5 3
b) 100 81 64 49 36 25
c) 20 18 16 14 12
IN QB64

Answers

Answered by allysia
0

Language:

Qbasic

Program:

a)

CLS

FOR i = 9 TO 3 STEP -2

PRINT i;

NEXT i

END

b)

CLS

FOR i = 10 TO 5 STEP -1

PRINT i^2;

NEXT i

END

c)

CLS

FOR i =20 TO 12 STEP -2

PRINT i;

NEXT i

END

Output:

consider the attachment.

a) 9 7 5 3

b) 100 81 64 49 36 25

c) 20 18 16 14 12

Explanation:

  • For loop and step keeps a gap of step between two consecutive numbers it prints.

Attachment:

Attachments:
Similar questions