Creat a program to demonstrate the use of Unary operators. | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 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 Antwort
0
!
21st Sep 2018, 11:18 AM
Matthias
Matthias - avatar