417 views
1 votes
1 votes
int main()
{
    char ch=1;
    while(ch<256)
    ch++;
    printf("loop end");
    return 0;
}

My doubt here is , will it give undefined behaviour? As we are storing integer value inside character variable and also is incrementation of character pointer will give some error?

1 Answer

1 votes
1 votes
Range of char variable is (-128,127) so it will never be  greater than 256 it will loop inside the while loop forever

No related questions found