What happens if you try to compile and run this program?

Last Updated on May 1, 2022 by Admin 2

What happens if you try to compile and run this program?

#include <stdio.h>

int main(void) {
    int i = -1, j = 1;
    
    for(i++; i++; i++)
       j++;

    printf("%d", i + j);
    return 0;
}
  • the program outputs 2
  • the program outputs 1
  • the program outputs enters an infinite loop and outputs nothing
  • the program outputs 3
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments