Computer Studies
Write 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
QBASIC
QBASIC: Input Statement
101 Likes
Answer
Cls
Input "Enter value of a "; a
Input "Enter value of b "; b
Let ans = a * a + b * b
Print "Value of expression 1 = "; ans
Let ans = (a + b) / (a * b)
Print "Value of expression 2 = "; ans
End
Output
Enter value of a ? 4
Enter value of b ? 5
Value of expression 1 = 41
Value of expression 2 = .45
Answered By
37 Likes
Related Questions
Write a program in QBASIC format to accept the length of a rod in millimetres and express the same in centimetres and metres.
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 = 4
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.
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.