C Programming - Input / Output - Discussion

Discussion Forum : Input / Output - Find Output of Program (Q.No. 12)
12.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    FILE *fp;
    char ch, str[7];
    fp=fopen("try.c", "r"); /* file 'try.c' contains "This is Nagpur" */
    fseek(fp, 9L, SEEK_CUR);
    fgets(str, 5, fp);
    puts(str);
    return 0;
}
agpur
gpur
Nagp
agpu
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
30 comments Page 3 of 3.

Ushir said:   4 years ago
What is the return type of fseek () ? Please explain.

Sparsha said:   1 decade ago
Why fp is taking a and not N? when 9th letter is N?

Lohithendra kumar said:   1 decade ago
Thank you guys for saying about fseek.

Vishal said:   1 decade ago
How agpu is correct please tell?

Gouthami said:   1 decade ago
We want more explanation.

RAHUL said:   1 decade ago
What about fseek guys?

Swa said:   7 years ago
Thank you @Ojeswani.

Priya said:   5 years ago
Thank you @Shraddha.

Dada said:   7 years ago
Agree @Rohit.

Vikas Sharma said:   1 decade ago
Thanks bro!


Post your comments here:

Your comments will be displayed after verification.