Write QB64 statement to add values of X and Y and store the sum in Z
Answers
Answered by
63
10 CLS
20 INPUT "ENTER THE VALUE OF X";X
30 INPUT "ENTER THE VALUE OF Y";Y
40 Z=X+Y
50 PRINT "THE SUM IS";Z
60 END
20 INPUT "ENTER THE VALUE OF X";X
30 INPUT "ENTER THE VALUE OF Y";Y
40 Z=X+Y
50 PRINT "THE SUM IS";Z
60 END
anirbanroy:
or, you may also omit the line numbers
20 INPUT "ENTER THE VALUE OF X";X
30 INPUT "ENTER THE VALUE OF Y";Y
40 Z=X+Y END
Answered by
21
- The basic algorithm/steps are:
- Take input of two numbers from the user.
- These two numbers will be stored in 2 variables/placeholders. say X and Y
- Store their sum in a third variable say Z.
- Print Z.
- The code for this is:
CLS
INPUT "Enter the first number" ;X
INPUT "Enter the second number" ;Y
LET Z = X + Y
PRINT "The sum of X and Y is:" ;Z
END
Similar questions