What will be the output of the following C code (run without any command line arguments)?
#include
int main(int argc, char *argv[])
{
while (*argv++ != NULL)
printf("%s\n", *argv);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
What is the output of this C code?
#include
void foo(int*);
int main()
{
int i = 10, *p = &i;
foo(p++);
}
void foo(int *p)
{
printf("%d\n", *p);
}
Answer: A
No answer description available for this question.
Enter details here
Which is an indirection operator among the following?
Answer: B
No answer description available for this question.
Enter details here
Which of the following does not initialize ptr to null (assuming variable declaration of a as int a=0;
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 = &x;
printf("%d\n", *ptr);
}
Answer:
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[])
{
printf("%s\n", argv[argc]);
return 0;
}
Answer: A
No answer description available for this question.
Enter details here
Every time we supply new set of values to the program at command prompt, we need to recompile the program.
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?
cmd> sample friday tuesday sunday
/* sample.c */
#include
int main(int argc, char *argv[])
{
printf("%c", *++argv[2] );
return 0;
}
Answer: C
No answer description available for this question.
Enter details here
What will be the output of this program (prg_1.c)?
#include
int main(int argc,char* argv[])
{
printf("%d",argc);
return 0;
}
Answer: B
No answer description available for this question.
Enter details here
What is the output of this C code?
#include
int main()
{
int i = 10;
void *p = &i;
printf("%f\n", *(float*)p);
return 0;
}
Answer: D
No answer description available for this question.
Enter details here