write a program in java to find sum of two numbers
Answers
Answered by
5
import java.util.Scanner;
class sum
{
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
int a,b,s=0;
System.out.println("Enter two nos.");
a=sc.nextInt();
b=sc.nextInt();
s= a+b;
System.out.println("The sum is"+s);
}
}
class sum
{
public static void main(String args[])
{
Scanner sc= new Scanner(System.in);
int a,b,s=0;
System.out.println("Enter two nos.");
a=sc.nextInt();
b=sc.nextInt();
s= a+b;
System.out.println("The sum is"+s);
}
}
Answered by
1
public class sum
{
void main(int a , int b)
{
int sum = a+b;
System.out.println("the sum of two number is :"+sum);
}
}
{
void main(int a , int b)
{
int sum = a+b;
System.out.println("the sum of two number is :"+sum);
}
}
Similar questions
Math,
8 months ago
Hindi,
8 months ago
History,
8 months ago
Social Sciences,
1 year ago
English,
1 year ago
Accountancy,
1 year ago