+ 1

Creat a program to demonstrate the use of Unary operators.

class UnaryArithmetic { public static void main(String args []) { int a=20 , result; result = +a; System.out.println(result); result = -a; System.out.println(result); result = ++a; System.out.println(result); result = --a; System.out.println(result); result = a++; System.out.println(result); result = a--; System.out.println(result); } }

21st Sep 2018, 11:08 AM
Manya
Manya - avatar
1 Odpowiedź
0
!
21st Sep 2018, 11:18 AM
Matthias
Matthias - avatar