Doubt
[closed]

in Programming in C closed by
193 views
0 votes
0 votes
closed with the note: undefined behaviour in C
#include <stdio.h>
int main()
{
    int i = 0;
    do
    {
        printf("Hello ");
        i = i++;
    }
    while (i < 5);
    return 0;
}
why this prints Hello infinitely?

shouldn't it print Hello 5 times?
in Programming in C closed by
by
193 views

1 comment

there is an error in the declaration : i=i++ ; that invokes an undefined behaviour. 

 

 

0
0