40.7k views
2 votes
Write a program that takes three numbers and prints their sum. Every

number is given on a separate line.

1 Answer

6 votes

Answer:

This solution is implemented in python

num1 = float(input("Number 1: "))

num2 = float(input("Number 2: "))

num3 = float(input("Number 2: "))

print("Sum: "+str(num1+num2+num3))

Step-by-step explanation:

This line prompts the user for the first number

num1 = float(input("Number 1: "))

This line prompts the user for the second number

num2 = float(input("Number 2: "))

This line prompts the user for the third number

num3 = float(input("Number 2: "))

This calculates and prints the sum

print("Sum: "+str(num1+num2+num3))

User Tsewang
by
4.7k points