" + " (Addition)
" – " (Subtraction)
" * " (Multiplication)
" / " (Division)
" %" (Modulus)
Example:-
public class math;
{
public static void main(string[] arg)
{
int x,y,answer;
x=60;
y=30;
answer=x+y; //(perform add operation)
answer=x-y; //(perform sub operation)
answer=x*y; //(perform mul operation)
answer=x/y; //(perform div operation)
answer=x%y; //(perform mod operation)
System.out.println(“Answer of addition =”+ answer);
}
}
0 Comments:
Post a Comment