WAP in java using unary operators.
Answers
Answered by
2
Hey there!
Program using Unary operators are:
class Unary_operators
{ public static void main(String Args[])
{ int a,b,c,d;
a = 58
b = a++;
c = ++a - b;
d = ++c;
System.out.println("the value of a is"+a);
System.out.println("the value of b is"+b);
System.out.println("the value of c is"+c);
System.out.println("the value of d is"+d);
} }
Program using Unary operators are:
class Unary_operators
{ public static void main(String Args[])
{ int a,b,c,d;
a = 58
b = a++;
c = ++a - b;
d = ++c;
System.out.println("the value of a is"+a);
System.out.println("the value of b is"+b);
System.out.println("the value of c is"+c);
System.out.println("the value of d is"+d);
} }
Answered by
0
class program
{
Public void main ()
{
int a;
a = ++a;
System.out.println("The value of a = " + a);
}
}
{
Public void main ()
{
int a;
a = ++a;
System.out.println("The value of a = " + a);
}
}
Similar questions