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

Last Updated on May 1, 2022 by Admin 3

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

#include <stdio.h>

int main(void) {
    int i;
    i = fprintf(stdin, "HELLO!");

    printf("%d", i == EOF);
    return 0;
}
  • the program outputs 2 
  • the program outputs 1
  • the program outputs 0 
  • the compilation or the execution fails
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments