+ 2

in c++ which operator has only one operand located at its right and the only thing that it does inverse the value of it

options:a)! b)&& c)|| d)scope resolution operator

20th Sep 2017, 2:47 PM
Jaya Varshini
Jaya Varshini - avatar
3 Réponses
+ 3
Thats a) ! Eg : bool a = false; cout<<!a<<endl; //Prints 1.
20th Sep 2017, 4:14 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 1
The '!' flips between true and false (0 and non zero), is an inversion of sorts for Boolean. The '~' flips every bit in an int (including Boolean). ie is is like doing a '!', but for each bit individually.
21st Sep 2017, 2:02 AM
Jared Bird
Jared Bird - avatar
+ 1
tq😊
21st Sep 2017, 11:02 AM
Jaya Varshini
Jaya Varshini - avatar