- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAdd.java
More file actions
Latest commit
19 lines (19 loc) · 385 Bytes
/
Copy pathAdd.java
File metadata and controls
19 lines (19 loc) · 385 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
importjava.util.Scanner;
classAdd
{
publicstaticvoidmain(String[] arg)
{
inta,b,c;
Scannersc=newScanner(System.in);
System.out.println("Enter first number");
a=sc.nextInt();
System.out.println("Enter second number");
b=sc.nextInt();
c=addition(a,b);
System.out.println(" Addition of two numbers is : "+c);
}
staticintaddition(intx,inty)
{
returnx+y;
}
}