Computer Studies

You want to calculate the total runs made by Sachin Tendulkar only in terms of centuries and half-centuries in test matches. Write a program in the QBASIC format taking the numbers of centuries and half-centuries as input. Display the total runs made by Sachin in centuries and half-centuries separately.

QBASIC

QBASIC: Input Statement

10 Likes

Answer

Cls
Input "Enter the number of centuries "; c
Let runs = c * 100
Print "Total runs in "; c; " centuries = "; runs
Input "Enter the number of half-centuries "; hc
Let runs = hc * 50
Print "Total runs in"; hc; " half-centuries = "; runs
End

Output

Enter the number of centuries ? 250
Total runs in 250 centuries = 25000
Enter the number of half-centuries ? 570
Total runs in 570 half-centuries = 28500

Answered By

4 Likes


Related Questions