Sail E0 Webinar

MCQs

Total Questions : 45 | Page 1 of 5 pages
Question 1. Determine output:
void main()
{
int const *p=5;
printf("%d", ++(*p));
}
  1.    6
  2.    5
  3.    Garbage Value
  4.    Compiler Error
 Discuss Question
Answer: Option D. -> Compiler Error
Question 2. Determine Output:
void main()
{
char s[]="man";
int i;
for(i=0; s[i]; i++)
printf("%c%c%c%c ", s[i], *(s+i), *(i+s), i[s]);
}
  1.    mmm nnn aaa
  2.    mmmm nnnn aaaa
  3.    Compiler Error
  4.    None of These
 Discuss Question
Answer: Option D. -> None of These
Question 3. Determine Output:
void main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I hate Examveda");
else
printf("I love Examveda");
}
  1.    I hate Examveda
  2.    I love Examveda
  3.    Error
  4.    None of These
 Discuss Question
Answer: Option B. -> I love Examveda
Question 4. Determine Output:
void main()
{
static int var = 5;
printf("%d ", var--);
if(var)
main();
}
  1.    5 5 5 5 5
  2.    5 4 3 2 1
  3.    Infinite Loop
  4.    None of These
 Discuss Question
Answer: Option B. -> 5 4 3 2 1
Question 5. Determine Output:
void main()
{
char *p;
printf("%d %d", sizeof(*p), sizeof(p));
}
  1.    1 1
  2.    1 2
  3.    2 1
  4.    2 2
 Discuss Question
Answer: Option B. -> 1 2
Question 6. Determine the Final Output:
void main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
}
  1.    absiha
  2.    asiha
  3.    haasi
  4.    hai
 Discuss Question
Answer: Option D. -> hai
Question 7. Determine Output:
void main()
{
int c = - -2;
printf("c=%d", c);
}
  1.    1
  2.    -2
  3.    2
  4.    Error
 Discuss Question
Answer: Option C. -> 2
Question 8. Determine Output:
void main()
{
int i=10;
i=!i>14;
printf("i=%d", i);
}
  1.    10
  2.    14
  3.    0
  4.    1
 Discuss Question
Answer: Option C. -> 0
Question 9. Determine Output:
void main()
{
int i=3;
switch(i)
{
default: printf("zero");
case 1: printf("one"); break;
case 2: printf("two"); break;
case 3: printf("three"); break;
}
}
  1.    zero
  2.    three
  3.    Error
  4.    None of These
 Discuss Question
Answer: Option B. -> three
Question 10. Determine Output:
#define int char
void main()
{
int i = 65;
printf("sizeof(i)=%d", sizeof(i));
}
  1.    sizeof(i)=2
  2.    sizeof(i)=1
  3.    Compiler Error
  4.    None of These
 Discuss Question
Answer: Option B. -> sizeof(i)=1

Latest Videos

Latest Test Papers