Print whether the given integer is positive or negative in cpp? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Print whether the given integer is positive or negative in cpp?

without using 1)no function other than main 2)no conditional statements 3)no shift operators 4)no logical operators 5)no loops 6)no arithmetic operators 6)no relational operators ternary operator can be used

27th Jul 2018, 2:27 PM
Ravindra Babu
2 Antworten
0
cout << (x<0 ? "negative" : "positive");
27th Jul 2018, 5:37 PM
Bebida Roja
Bebida Roja - avatar
4th Aug 2018, 8:13 AM
Ravindra Babu