Print whether the given integer is positive or negative in cpp? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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 ответов
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