-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main (1).java
33 lines (29 loc) · 886 Bytes
/
Main (1).java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/******************************************************************************
*******************************************************************************/
public class Main
{
public static void main(String[] args) {
int a=10, b=2;
System.out.println("Soma = "+ soma(a,b));
System.out.println("Subtracao = "+ subtracao(a,b));
System.out.println("Produto= "+ prod(a,b));
System.out.println("Resto = "+ resto(a,b));
System.out.println("Divisao = "+ divisao(a,b));
}
public static int soma(int a, int b){
return a+b;
}
public static int subtracao(int a, int b){
return a-b;
}
public static int prod(int a, int b){
return a*b;
}
public static int resto(int a, int b){
return b%a;
}
public static int divisao(int a, int b){
if(b==0)return 0;
return a/b;
}
}