91. What will be the output of the following C code?
#include <stdio.h>
int main()
{
srand(time(NULL));
printf("%d\n", rand());
return 0;
}
#include <stdio.h>
int main()
{
srand(time(NULL));
printf("%d\n", rand());
return 0;
}
92. What will be the output of the following C code?
#include <stdio.h>
#include <string.h>
int main()
{
char line[3];
FILE *fp;
fp = fopen("newfile.txt", "r");
while (fgets(line, 3, fp))
fputs(line, stdout);
return 0;
}
#include <stdio.h>
#include <string.h>
int main()
{
char line[3];
FILE *fp;
fp = fopen("newfile.txt", "r");
while (fgets(line, 3, fp))
fputs(line, stdout);
return 0;
}
93. What will be the output of the following C code?
char str[] = "Hello Nancy“;
printf(“\n %.7s”, str) ;
char str[] = "Hello Nancy“;
printf(“\n %.7s”, str) ;
94. What will be the output of the following C code?
#include <stdio.h>
int main(int argc, char **argv)
{
char *s = "myworld";
int i = 3;
printf("%10.*s", i, s);
}
#include <stdio.h>
int main(int argc, char **argv)
{
char *s = "myworld";
int i = 3;
printf("%10.*s", i, s);
}
95. What is the syntax of ungetc()?
96. scanf() is a predefined function in. . . . . . . .header file.
Read More Section(File Input Output)
Each Section contains maximum 100 MCQs question on File Input Output. To get more questions visit other sections.