Computer Science, asked by java1, 1 year ago

write a program in java to find sum of two numbers

Answers

Answered by Nishit1
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);
}
}
Answered by Karam
1
public class sum
{
void main(int a , int b)
{
int sum = a+b;
System.out.println("the sum of two number is :"+sum);
}
}
Similar questions