following program should print "error" but its 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 for comparison makes them equal again. But it should cause the compiler to emit a warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With