51. What will be the output of the following C code?
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("%d\n", rand() % 1000);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("%d\n", rand() % 1000);
return 0;
}
52. If the mode includes b after the initial letter, what does it indicates?
53. What will be the output of the following C code if following commands are used to run (considering myfile exists)?
gcc -otest test.c
./test > myfile
#include <stdio.h>
int main(int argc, char **argv)
{
char c = 'd';
putchar(c);
printf(" %d\n", argc);
}
gcc -otest test.c
./test > myfile
#include <stdio.h>
int main(int argc, char **argv)
{
char c = 'd';
putchar(c);
printf(" %d\n", argc);
}
54. What will be the output of the following C code?
scanf(“ %d %d %d”,&n1,&n2);
scanf(“ %d %d %d”,&n1,&n2);
55. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 10, j = 2;
printf("%d\n", printf("%d %d ", i, j));
}
#include <stdio.h>
int main()
{
int i = 10, j = 2;
printf("%d\n", printf("%d %d ", i, j));
}
56. A fatal error will be generated if the format string is ended with a white space character.
57. Which of the following mode argument is used to truncate?
58. What will be the output of the following C code?
#include <stdio.h>
#include <stdarg.h>
int f(char c, ...);
int main()
{
char c = 97, d = 98;
f(c, d);
return 0;
}
int f(char c, ...)
{
va_list li;
va_start(li, c);
char d = va_arg(li, char);
printf("%c\n", d);
va_end(li);
}
#include <stdio.h>
#include <stdarg.h>
int f(char c, ...);
int main()
{
char c = 97, d = 98;
f(c, d);
return 0;
}
int f(char c, ...)
{
va_list li;
va_start(li, c);
char d = va_arg(li, char);
printf("%c\n", d);
va_end(li);
}
59. What does the following command line signify?
prog1|prog2
prog1|prog2
60. Which function has a return type as char pointer?
Read More Section(File Input Output)
Each Section contains maximum 100 MCQs question on File Input Output. To get more questions visit other sections.