Sail E0 Webinar

MCQs

Total Questions : 45 | Page 2 of 5 pages
Question 11. Determine Output:
void main()
{
char string[]="Hello World";
display(string);
}
void display(char *string)
{
printf("%s", string);
}
  1.    will print Hello World
  2.    Compiler Error
  3.    Can't Say
  4.    None of These
 Discuss Question
Answer: Option B. -> Compiler Error
Question 12. Determine Output:
void main()
{
int i=5;
printf("%d%d%d%d%d", i++, i--, ++i, --i, i);
}
  1.    45545
  2.    54544
  3.    55445
  4.    54554
 Discuss Question
Answer: Option A. -> 45545
Question 13. Determine Output:
#define square(x) x*x
void main()
{
int i;
i = 64/square(4);
printf("%d", i);
}
  1.    4
  2.    64
  3.    16
  4.    None of These
 Discuss Question
Answer: Option B. -> 64
Question 14. Determine Output:
#include
#define a 10
void main()
{
#define a 50
printf("%d", a);
}
  1.    50
  2.    10
  3.    Compiler Error
  4.    None of These
 Discuss Question
Answer: Option A. -> 50
Question 15. Determine Output:
void main()
{
char *p="hi friends", *p1;
p1=p;
while(*p!='\0') ++*p++;
printf("%s", p1);
}
  1.    hi friends
  2.    ij!gsjfoet
  3.    hj grjeodt
  4.    None of These
 Discuss Question
Answer: Option B. -> ij!gsjfoet
Question 16. Determine Output:
#define clrscr() 100
void main()
{
clrscr();
printf("%d", clrscr());
}
  1.    0
  2.    1
  3.    100
  4.    Error
 Discuss Question
Answer: Option C. -> 100
Question 17. Determine Output:
void main()
{
printf("%p", main);
}
  1.    Error
  2.    make an infinite loop
  3.    Some address will be printed
  4.    None of These
 Discuss Question
Answer: Option C. -> Some address will be printed
Question 18. Determine Output:
void main()
{
char far *farther, *farthest;
printf("%d..%d", sizeof(farther), sizeof(farthest));
}
  1.    4..2
  2.    2..2
  3.    4..4
  4.    2..4
 Discuss Question
Answer: Option A. -> 4..2
Question 19. Determine Output:
void main()
{
char *p;
p="Hello";
printf("%c", *&*p);
}
  1.    Hello
  2.    H
  3.    Some Address will be printed
  4.    None of These
 Discuss Question
Answer: Option B. -> H
Question 20. Determine Output:
void main()
{
int i=1;
while(i2)
goto here;
i++;
}
}
fun()
{
here: printf("PP");
}
  1.    12PP
  2.    12PP345
  3.    Compiler Error
  4.    None of These
 Discuss Question
Answer: Option C. -> Compiler Error

Latest Videos

Latest Test Papers