Why would you need to use the not operator? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why would you need to use the not operator?

7th Jan 2016, 6:12 AM
Jackson
2 Answers
+ 1
if(age != 18) cout << "you are not 18 years old"; Also used a lot in Boolean. if(!t) you could use if(false), but you could have t declared as a Boolean variable.
25th Feb 2016, 6:56 AM
sage cogar
sage cogar - avatar
0
in some programs we need to invert logical results
18th Jan 2016, 10:46 AM
Hamid reza Kaveh pishghadam
Hamid reza Kaveh pishghadam - avatar