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:

  1. a2+b 2
  2. (a+b) / ab

QBASIC

QBASIC: Input Statement

102 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