write a program in qbasic so as to print a triangular pattern (not a right angled triangle ) rows - 5
1
101
10101
1010101
101010101
Answers
Answered by
93
CLS
FOR i = 1 , 3 , 5, 7 , 9
FOR j = 1 TO 1
x = j MOD 2
FOR j = 1 TO 3
x = j MOD 2,
FOR j = 1 TO 1 to 5
x = j MOD 2
FOR j = 1 TO 1 to 7
x = j MOD 2
FOR j = 1 TO 1 to 9
x = j MOD 2
PRINT x;
NEXT j
NEXT i
END
1
101
10101
1010101
101010101
_______________________________________
Bᴇʏᴏɴᴅᴇʀ:
Perfect!
Similar questions