write a Java program accept two numbers find out sum of two numbers and print the result
Answers
Answered by
9
Answer:
class sum
{
public static void main (String args [])
{
int,a,b,s;
s=a+b;
System.out.println(Sum of two numbers ="+s)
{
{
Answered by
0
package com.company;
import java.util.Scanner;
class test
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter first number: ");
long n1 = sc.nextLong();
System.out.println("Enter second number: ");
long n2 = sc.nextLong();
System.out.println("The sum of the numbers: "+Math.addExact(n1,n2));
}
}
Similar questions
Social Sciences,
5 months ago
Science,
5 months ago
Hindi,
5 months ago
Math,
11 months ago
Biology,
11 months ago
Math,
1 year ago
Psychology,
1 year ago