Creat a program to demonstrate the use of Unary operators. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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 Réponse
0
!
21st Sep 2018, 11:18 AM
Matthias
Matthias - avatar