Question 1 of 25
Hints left: 3
Q1
What is the purpose of the 'rewind' function in C?
Q2
Which function is used to delete a file in C?
Q3
How do you check if a file was opened successfully in C?
Q4
Which function is used to move the file pointer to a specific position in a file?
Q5
Which function is used to close a file in C?
Q6
Which function is used to open a file in C for writing?
Q7
What is the difference between 'r' and 'w' modes when opening a file in C?
Q8
How do you read a character from a file in C?
Q9
What is the difference between 'r+' and 'w+' modes when opening a file in C?
Q10
In C, what is the function of the 'feof' function?
Q11
Which function is used to write data to a file in C?
Q12
What is the purpose of the 'ftell' function in C?
Q13
Which function is used to read a line of text from a file in C?
Q14
What will be the output of the following C code? #include <stdio.h> struct point { int x; int y; }; struct notpoint { int x; int y; }; void foo(struct point); int main() { struct notpoint p1 = {1, 2}; foo(p1); } void foo(struct point p) { printf("%d\n", p.x); }
Q15
What will be the output of the following C code? #include <stdio.h> struct p { int x[2]; }; struct q { int *x; }; int main() { struct p p1 = {1, 2}; struct q *ptr1 = (struct q*)&p1; ptr1->x = (struct q*)&p1.x; printf("%d\n", ptr1->x[0]); }
Q16
What does 'FILE' represent in C when working with files?
Q17
What will be the output of the following C code? #include <stdio.h> struct { int k; char c; }; int main() { struct p; p.k = 10; printf("%d\n", p.k); }
Q18
What is the purpose of the 'fprintf' function in C?
Q19
How do you check if a file exists in C?
Q20
What will be the output of the following C code? #include <stdio.h> typedef struct student { char *a; }stu; void main() { stu s; s.a = "hi"; printf("%s", s.a); }
Q21
What does the 'fread' function in C do?
Q22
typedef int (*PFI)(char *, char *)creates . . . . . . . .
Q23
In C, what does the 'feof' function return if the end of the file is reached?
Q24
In C, which library is used for file operations such as reading and writing files?
Q25
Which function is used to rename a file in C?