Computer Science, asked by BrainlyHelper, 1 year ago

WAP in java to add two numbers.

Answers

Answered by duragpalsingh
2
Hey there!

Program to add two numbers are:

\\Durag's Answer from Brainly
class Addition
{public static void main(String Args[])
{ int a,b,c;
a = 5;
b = 2;
c = a+b;
System.out.println("the sum is"+c);
}
}

Output:
The sum is 7.
Answered by Riyuuuuu
1
Hey!!!
_________
Here is your answer!!!
________________
import java .util. *;
public class add
{
public static void main(String args[])
{
int a,b,c;
System.out.println("Enter two nos");
a=in.nextInt();
b=in.nextInt();
System.out.println("Sum of two numbers ");
c=a+b;
System.out.println(c);
}
}
_____________
I hope it will help you!!!
Similar questions