CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Comparing Signed and Unsigned Integers

C++ code walkthrough · Question 49
hardType Conversion

Code

Read carefully. What does this print?
1#include <iostream>
2using namespace std;
3 
4int main() {
5 unsigned int u = 3;
6 int i = -1;
7 if (i < u)
8 cout << "less" << endl;
9 else
10 cout << "not less" << endl;
11 cout << (i < u) << endl;
12 return 0;
13}

Your answer