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.
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
EndOutput
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
Related Questions
Write a program in QBASIC format to print the total amount paid to the shopkeeper for purchasing the following items:
Number of exercise books = 10 Number of brown paper rolls = 4Write a program in QBASIC to find the value of the given expressions after taking a suitable value of a and b from the console:
- a2+b 2
- (a+b) / ab
In an examination, 20% students failed in English and 30% failed in Maths. Write a program in QBASIC format to find the total number of students who failed in both the subjects taking the total number of students in the class as input.
Write a program in QBASIC format to find the value of 's' in the given equation, taking the suitable value of 'u' , 'v' and 'a' as input.
s = (v2 - u2) / 2a