Computer Science, asked by guddu45, 1 year ago

Write QB64 statement to add values of X and Y and store the sum in Z

Answers

Answered by anirbanroy
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

anirbanroy: or, you may also omit the line numbers
anirbanroy: 10 CLS
20 INPUT "ENTER THE VALUE OF X";X
30 INPUT "ENTER THE VALUE OF Y";Y
40 Z=X+Y END
Answered by Anonymous
21
  • The basic algorithm/steps are:
  1. Take input of two numbers from the user.
  2. These two numbers will be stored in 2 variables/placeholders. say X and Y
  3. Store their sum in a third variable say Z.
  4. 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