The program below has a bug. Which statement correctly describes it?
#include <stdio.h>
int main(void) {
int count = 0;
for (int i = 0; i < 3; i++)
count = count++;
printf("%d\n", count);
return 0;
}
The postfix increment and the assignment both write count, unordered. Many compilers print 0, some 3. Clang warns "multiple unsequenced modifications to count". Just write count++;.