Write a Qbask program to print the table of 18. in proper format.
Answers
Answered by
10
Correct Question:-
- Write a program in QBASIC to print the table of 18 in proper format
This is a very easy question.....Here is an approach.
Code:-
CLS
PRINT "TABLE OF 18 IS AS FOLLOWS:-"
FOR I=0 TO 10
P=18*I
PRINT "18×"+I+"="+P
NEXT I
END
Code Explanation:-
- The program prints "TABLE OF 18 IS AS FOLLOWS:-"
- The program runs a loop from 0 to 10
- In each iteration, the program multiplies 18 with the loop value and stores it in the variable P
- Then it prints the value in this format...
18 × <loop value> = <product of 18 and loop value>
- Loop value gets updated with +1
- When loop value becomes greater the the limit (Here limit is 10) Then the loop terminates.
- Finally, 'END' statement terminates the program
Required Output:-
THE TABLE OF 18 IS AS FOLLOWS:-
18×0=0
18×1=18
18×2=36
18×3=54
18×4=72
18×5=90
18×6=108
18×7=126
18×8=144
18×9=162
18×10=180
roshan9012:
Very Very thanks
Similar questions