C | C Quiz – 113 | Question 1
(A) Infinite Loop
(D) Run Time Error
Explanation: The result will be 1 but after a really long time because while loop will keep on going until i becomes 4294967295 (Assuming unsigned int is stored using 4 bytes) and as i highest limit of unsigned int is 4294967295 in next ++ operation it will become zero and we’ll come out of loop and 1 will be printed.
Since the time taken is long, on-line compiler may terminate the program with time limit exceeded error. If instead of unsigned int, you use unsigned short int then result (1) may come faster.
Quiz of this Question