Write a q basic program to input any 2 numbers and print their sum and product by leaving two lines in between
Answers
Answered by
2
Qbasic basic program to this question can be defined as below:
Output:
Input first number: 22
Input second number: 2
Addition is: 24
Multiplication is: 44
Explanation:
Program:
INPUT "Input first number:", NUM1 'input first number
INPUT "Input second number:", NUM2 'input first number
ADD = NUM1 + NUM2 'adding numbers
PRINT "Addition is:", ADD 'print value
PRINT " " 'leaving line spacing
PRINT " " 'leaving line spacing
MUL=NUM1*NUM2 'multiplying value
PRINT "Multiplication is:", MUL 'print value
Description of the above code:
- In the above Qbasic code, a "NUM1 and NUM2" variable is used the input method to take input from the user end.
- In the next step, the ADD variable is declared, which uses the "NUM1 and NUM2" variable to add both values in the next line the print method is used that prints its value.
- To two line spacing, the print method is used, which prints data into the next line, after that the MUL variable is defined that uses both variables for multiple values and uses print method to print its value.
Learn more:
- Program: https://brainly.in/question/1411874
- What is Qbasic: https://brainly.in/question/197597
Similar questions