I wrote this code and result is -6. Can someone explain why? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I wrote this code and result is -6. Can someone explain why?

#include<iostream> using namespace std; int main() { int x=5; cout<<~x; return 0; }

12th Aug 2018, 8:57 AM
Ayan Biswas
Ayan Biswas - avatar
1 Answer