What is the second argument in command line arguments?
Answer: B
No answer description available for this question.
Enter details here
What will be the output of the following C statement? (assuming the input is “cool brother in city”)
printf(“%s\n”, argv[argc]);
Answer: A
No answer description available for this question.
Enter details here
What is the output of this C code?
#include
void main()
{
int x = 0;
int *ptr = &5;
printf("%p\n", ptr);
}
Answer: D
No answer description available for this question.
Enter details here
Which of the following is TRUE about argv?
Answer: A
No answer description available for this question.
Enter details here
In Turbo C/C++ under DOS if we want that any wild card characters in the command-line arguments should be appropriately expanded, are we required to make any special provision?
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?
cmd> sample 1 2 3
cmd> sample 2 2 3
cmd> sample 3 2 3
/* sample.c */
#include
int main(int argc, char *argv[])
{
printf("%s\n", argv[0]);
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
What will be the output of this program?
#include
#include
int main(int argc,char* argv[])
{
int answer;
answer=atoi(argv[1])+atoi(argv[2]);
printf("%d",answer);
return 0;
}
Answer: D
No answer description available for this question.
Enter details here
What is the output of this C code?
#include
int main()
{
int i = 11;
int *p = &i;
foo(&p);
printf("%d ", *p);
}
void foo(int *const *p)
{
int j = 10;
*p = &j;
printf("%d ", **p);
}
Answer: A
No answer description available for this question.
Enter details here
What is the output of this C code?
#include
int x = 0;
void main()
{
int *const ptr = &x;
printf("%p\n", ptr);
ptr++;
printf("%p\n ", ptr);
}
Answer: B
No answer description available for this question.
Enter details here
If the different command line arguments are supplied at different times would the output of the following program change?
#include
int main(int argc, char **argv)
{
printf("%d\n", argv[argc]);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here