c++ - unsigned int value not giving correct result -
following program should print "error" printing success.why?
#include<iostream> using namespace std; int main() { unsigned int a; a=-10; if(a == -10) cout << "success" ; else cout << "error" ; return 0; }
the conversion comparison makes them equal again. should cause compiler emit warning.
Comments
Post a Comment