Arithmatic Operator Example
class oper1
{
public static void main (String aa[])
{
int a=20;
int b=a*2;
int c=b-30;
int d=c/2;
System.out.println("Result of a is"+a);
System.out.println("Result of a is"+b);
System.out.println("Result of a is"+c);
System.out.println("Result of a is"+d);
}}
Output -
Result of a = 20
Result of b = 40
Result of c = 10
Result of d =5
class oper1
{
public static void main (String aa[])
{
int a=20;
int b=a*2;
int c=b-30;
int d=c/2;
System.out.println("Result of a is"+a);
System.out.println("Result of a is"+b);
System.out.println("Result of a is"+c);
System.out.println("Result of a is"+d);
}}
Output -
Result of a = 20
Result of b = 40
Result of c = 10
Result of d =5
0 comments:
Post a Comment