What is Qbasic programmes to get the total numbers of any two giving numbers
Answers
Answered by
3
Correct Question.
- Write QBASIC program to find sum of two numbers entered by the user.
The Code.
CLS
INPUT "Enter first number: "; A
INPUT "Enter second number: "; B
SUM = A + B
PRINT "Sum of the numbers you entered is: "; SUM
END
Explanation.
- Line 1: Clears the screen.
- Line 2-3: Ask the user to enter the numbers.
- Line 4: Calculates the sum of two numbers.
- Line 5: The sum is displayed on the screen.
- Line 6: End of program.
See attachment for output.
Attachments:
Answered by
2
QBASIC::
CLS
INPUT "Enter first number :- ",num1
INPUT "Enter second number :- ",num2
PRINT "Total :- " + (num1 + num2)
END
Logic::
==> The variable num1 stores first number and num2 stores second.
==> They are added by the '+' operator.
==> Wooh! We finished the program
Hope This Helps You..♪
Similar questions