#include <stdio.h>
#include <stdlib.h>
typedef unsigned int U32;
int main() {
U32 var = -1;
printf("var = %u\n", var);
if(var != -1)
{
printf("\n I'm not -1\n");
}
else
{
printf("I'm -1 and Var :%u\n", var);
}
}
Here "-1" should be converted into an unsigned
int
and it should be assigned to var
. And then at the if
condition it should not be equal to -1. But it is going into the else
statement.