write a basic 256 programme to find the sum of 2 variables
Answers
Answered by
0
Answer:
' Ask the user for two numbers
' Add them up, print the sum.
'
PRINT "What is the first number"
INPUT NUMBER1
'
PRINT "What is the second number"
INPUT NUMBER2
'
LET SUM = NUMBER1 + NUMBER2
PRINT "The total is:", SUM
'
END
Here is an example run of the program:
What is the first number
? 15.2
What is the second number
? 2.5
The total is: 17.7
Explanation:
Answered by
0
Language:
BASIC-256
Program:
input "Enter first number: ", a
input "Enter second number: ", b
print "The sum is", a+b
Output:
input "Enter first number: ", a
input "Enter second number: ", b
print "The sum is", a+b
Explanation:
- Line 1: takes input in a
- Line 2: takes input in b
- Line 3: returns sum of a and b with a statement.
Attachments:
Similar questions