Java program for the sum of three given no.s 1,2,3
Answers
Answer:
Java program for the sum of three given no.s 1,2,3
6
Answer:
TO THE BEST OF MY KNOWLEDGE, THE ANSWER IS GIVEN BELOW
package com.adeepdrive.sorting;
import java.util.Scanner;
// Java-W3schools
public class SumThreeNumbers {
public static void main(String[] args) {
int number1;
int number2;
int number3;
Scanner scanner = new Scanner(System.in);
System.out.println("Enter numner 1 :1 ");
number1 = scanner.nextInt();
System.out.println("Enter numner 2 :2 ");
number2 = scanner.nextInt();
System.out.println("Enter numner 3 :3 ");
number3 = scanner.nextInt();
int finalResult = number1 + number2 + number3;
System.out.println("Final resut of sum of given three numbers is " + finalResult);
}
}
OUTPUT:
Enter numner 1 : 1
Enter numner 2 : 2
Enter numner 3 : 3
Final result of the sum of given three numbers is 6