1-
|
stderr, stdin, stdout are FILE pointers
|
|
A -
|
Yes
|
|
B -
|
No
|
2-
|
A file written in text mode can be read back in binary mode.
|
|
A -
|
Yes
|
|
B -
|
No
|
3-
|
Will the following program work?
#include<stdio.h>
int main()
{
int n=5;
printf("n=%*d\n", n, n);
return 0;
}
|
|
A -
|
Yes
|
|
B -
|
No
|
4-
|
Can we specify a variable filed width in a scanf() format string?
|
|
A -
|
Yes
|
|
B -
|
No
|
5-
|
The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
|
|
A -
|
128 characters
|
|
B -
|
256 characters
|
|
C -
|
67 characters
|
|
D -
|
It may vary from one operating system to another
|
6-
|
According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?
|
|
A -
|
int main(int argc, char *argv[])
|
|
B -
|
int main(argc, argv) int argc; char *argv;
|
|
C -
|
int main() { int argc; char *argv; }
|
|
D -
|
None of above
|
7-
|
What do the 'c' and 'v' in argv stands for?
|
|
A -
|
'c' means argument control 'v' means argument vector
|
|
B -
|
'c' means argument count 'v' means argument vertex
|
|
C -
|
'c' means argument count 'v' means argument vector
|
|
D -
|
'c' means argument configuration 'v' means argument visibility
|
8-
|
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three
/* myprog.c */
#include<stdio.h>
int main(int argc, char **argv)
{
printf("%c\n", **++argv);
return 0;
}
|
|
A -
|
myprog one two three
|
|
B -
|
myprog one
|
|
C -
|
o
|
|
D -
|
two
|
9-
|
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog one two three
/* myprog.c */
#include<stdio.h>
#include<stdlib.h>
int main(int argc, char **argv)
{
printf("%s\n", *++argv);
return 0;
}
|
|
A -
|
myprog
|
|
B -
|
one
|
|
C -
|
two
|
|
D -
|
three
|
10-
|
What will be the output of the program (sample.c) given below if it is executed from the command line (Turbo C in DOS)?
cmd> sample 1 2 3
/* sample.c */
#include<stdio.h>
int main(int argc, char *argv[])
{
int j;
j = argv[1] + argv[2] + argv[3];
printf("%d", j);
return 0;
}
|
|
A -
|
6
|
|
B -
|
sample 6
|
|
C -
|
Error
|
|
D -
|
Garbage value
|