33.
In the below C program, every time program is run different numbers are generated.
#include <stdio.h>
#include <stdlib.h>
int main()
{
    printf("%d\n", rand());
    return 0;
}

34.
What does the ungetc function return for the following C expression?
ungetc(c, fp);//where declarations are int c and FILE *fp

36.
Why do we write (int *) before malloc?
int *ip = (int *)malloc(sizeof(int));

38.
What will be the output of the following C code?
#include <stdio.h>
int main()
{
    FILE *fp;
    char c;
    int n = 0;
    fp = fopen("newfile1.txt", "r");
    while (!feof(fp))
    {
        c = getc(fp);
        putc(c, stdout);
    }
}

Read More Section(File Input Output)

Each Section contains maximum 100 MCQs question on File Input Output. To get more questions visit other sections.