QBASIC PROGRAMMING STATEMENTS
I
QUESTION:
Accept a number from user. If the given number is even, find its cube and display, otherwise, print its
multiplicative table.
Answers
Answered by
0
Answer:
sry I don't no what is an answer sry
Answered by
0
Program:
Dim n As Integer
Dim c As Integer
Dim i As Integer
Cls
Input "Enter a number : ", n
If n Mod 2 = 0 Then
c = n * n * n
Print "Cube = "; c
Else
For i = 1 To 10
Print n; " * "; i; " = "; n * i
Next i
End If
End
Output 1:
Enter a number : 8
Cube = 512
Output 2:
Enter a number : 5
5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50
Similar questions
India Languages,
1 month ago
Accountancy,
3 months ago
Physics,
3 months ago
Chemistry,
9 months ago