11. What is function srand(unsigned)?
12. What is the purpose of the C function?
int ferror(FILE *fp)
int ferror(FILE *fp)13. What if size is zero in the following C statement?
realloc(ptr, size)
realloc(ptr, size)14. Select the right explanation to the given code.
printf(“%*. *f”, 5,4,5700);
printf(“%*. *f”, 5,4,5700);15. Which of the following should be used for freeing the memory allocated in the following C code?
#include <stdio.h>
struct p
{
struct p *next;
int x;
};
int main()
{
struct p *p1 = (struct p*)malloc(sizeof(struct p));
p1->x = 1;
p1->next = (struct p*)malloc(sizeof(struct p));
return 0;
}
#include <stdio.h>
struct p
{
struct p *next;
int x;
};
int main()
{
struct p *p1 = (struct p*)malloc(sizeof(struct p));
p1->x = 1;
p1->next = (struct p*)malloc(sizeof(struct p));
return 0;
}16. Which of the following function with ellipsis are illegal?
17. What will be the output of the following C code?
#include <stdio.h>
struct p
{
struct p *next;
int x;
};
int main()
{
struct p *p1 = calloc(1, sizeof(struct p));
p1->x = 1;
p1->next = calloc(1, sizeof(struct p));
printf("%d\n", p1->next->x);
return 0;
}
#include <stdio.h>
struct p
{
struct p *next;
int x;
};
int main()
{
struct p *p1 = calloc(1, sizeof(struct p));
p1->x = 1;
p1->next = calloc(1, sizeof(struct p));
printf("%d\n", p1->next->x);
return 0;
}18. Which of the following mathematical function requires 2 parameter for successful function call?
19. How many characters for pushback is guaranteed per file while using ungetc(c, fp);?
20. Which of the following function can be used to terminate the main() function from another function safely?
Read More Section(File Input Output)
Each Section contains maximum 100 MCQs question on File Input Output. To get more questions visit other sections.
