Computer Science, asked by bhumikhadka1988, 2 months ago

Input, Let and print statements.
b) Write a program to find the sum of any five numbers using LET and PRINT
statements.​

Answers

Answered by anindyaadhikari13
5

Solution.

The given co‎‎de is written in QBASIC.

CLS

LET A = 10

LET B = 20

LET C = 30

LET D = 40

LET E = 50

LET SUM = A + B + C + D + E

PRINT "The sum of the numbers is:"; SUM

END

Explanation.

  1. Line 1: Clears the screen.
  2. Line 2-6: Here, I have declared 5 numbers using let statement.
  3. Line 7: Here, the sum of 5 numbers is calculated.
  4. Line 8: The sum of the numbers is displayed.
  5. Line 9: End of program.

See attachment for output.

Attachments:
Similar questions