If the following program (myproc.c) is present in the directory "C:\TC" then what will be output of the program if run it from DOS shell?
/* myproc.c */
#include
int main(int argc, char *argv[])
{
printf("%s", argv[0]);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
Which is the correct form to declare main with command line arguments ?
Answer: B
No answer description available for this question.
Enter details here
Which of the following statements are FALSE about the below code?
int main(int ac, char *av[])
{
}
Answer: C
No answer description available for this question.
Enter details here
What is the signature of math in function using command line arguments?
Answer: D
Any of the above signature can be used while using command line arguments in C++ programs.
Enter details here
What is the output of this C code?
#include
int main()
{
int i = 97, *p = &i;
foo(&p);
printf("%d ", *p);
return 0;
}
void foo(int **p)
{
int j = 2;
*p = &j;
printf("%d ", **p);
}
Answer: A
No answer description available for this question.
Enter details here
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
int main(int argc, char *argv[])
{
int j;
j = argv[1] + argv[2] + argv[3];
printf("%d", j);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
What do the 'c' and 'v' in argv stands for?
Answer: C
No answer description available for this question.
Enter details here
The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
Answer: D
No answer description available for this question.
Enter details here
What will be the output of the following C code (run without any command line arguments)?
#include
int main(int argc, char *argv[])
{
while (argc--)
printf("%s\n", argv[argc]);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the program (sample.c) given below if it is executed from the command line (turbo c under DOS)?
cmd> sample Good Morning
/* sample.c */
#include
int main(int argc, char *argv[])
{
printf("%d %s", argc, argv[1]);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here