Computer Science, asked by brayanp2020, 9 months ago

Write a program that accepts three decimal numbers as input and outputs their sum.

Answers

Answered by kkcsrtanuja7486
3

Answer:

gduchdud if bxyddht to sch the do he do it so us an hour so fhxhsndzgdhxhxhdh so to is to us we on an overnight us to inform him enough all of well on your side of well as well if that to if go g to do do for go to go go go no coo coo

Answered by purveshKolhe
11

\bf{\underline{Java::}}

import java.util.Scanner; // Imports Scanner class.

public class Main { // Declares the class as public and names it Main.

  public static void main(String [] args) { // Main method.

     Scanner sc = new Scanner(System.in); // Scanner activation.

     System.out.println("Enter the three numbers : "); // Prints a string that asks for input.

     int num1 = sc.nextInt(); // Takes input in variable num1.

     int num2 = sc.nextInt(); // Takes input in variable num2.

     int num3 = sc.nextInt(); // Takes input in variable num3.

     System.out.println("The sum is " + (num1 + num2 + num3)); // Prints the result.

  }

}

\rule{300pt}{0.2em}

\bf{\underline{Python::}}

num1 = int(input()) # Takes input in num1.

num2 = int(input()) # Takes input in num2.

num3 = int(input()) # Takes input in num3.

print("The sum is ", (num1 + num2 + num3)) # Adds them and prints the  result.

\rule{300pt}{0.2em}

\bf{\underline{C++::}}

#include <iostream> // Includes the iostream header file.

using namespace std; // Using the standard namespace.

int main() { // Main method.

  int num1, num2, num3; // Declares three variables.

  cout << "Enter the numbers : " << endl; // Prints a string that asks for input.

  cin >> num1 >> num2 >> num3; // Takes input in  the declared variables.

  cout << "The sum is " << (num1 + num2 + num3); // Prints their sum.

  return 0; // The method returns 0;

}

Similar questions