Input / Output

Q1:
Point out the error in the program?
#include<stdio.h>

int main()
{
    FILE *fp;
    fp=fopen('trial', 'r');
    fseek(fp, '20', SEEK_SET);
    fclose(fp);
    return 0;
}

A Error: unrecognised Keyword SEEK_SET

B Error: fseek() long offset value

C No error

D None of above

ANS:A - Error: unrecognised Keyword SEEK_SET

Instead of '20' use 20L since fseek() need a long offset value.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.