Sail E0 Webinar

MCQs

Total Questions : 45 | Page 4 of 5 pages
Question 31. Determine Output:
void main()
{
char not;
not = !2;
printf("%d", not);
}
  1.    2
  2.    Garbage Value
  3.    0
  4.    None of These
 Discuss Question
Answer: Option C. -> 0
Question 32. Determine Output:
#include
void main()
{
register i=5;
char j[]= "hello";
printf("%s %d", j, i);
}
  1.    hello 5
  2.    hello garbage value
  3.    Error
  4.    None of These
 Discuss Question
Answer: Option A. -> hello 5
Question 33. Determine Output:
void main()
{
char a[]="12345";
int i = strlen(a);
printf("%d", ++i);
}
  1.    5
  2.    6
  3.    7
  4.    None of These
 Discuss Question
Answer: Option B. -> 6
Question 34. Determine Output:
void main()
{
int i = abc(10);
printf("%d", --i);
}
int abc(int i)
{
return(i++);
}
  1.    10
  2.    9
  3.    11
  4.    None of These
 Discuss Question
Answer: Option B. -> 9
Question 35. Determine Output:
void main()
{
int i=5, j=6, z;
printf("%d", i+++j);
}
  1.    12
  2.    13
  3.    11
  4.    None of These
 Discuss Question
Answer: Option C. -> 11
Question 36. Determine Output:
void main()
{
int i;
char a[]="�";
if(printf("%sn", a))
printf("Ok here n");
else
printf("Forget itn");
}
  1.    Ok here
  2.    Forget it
  3.    Error
  4.    None of These
 Discuss Question
Answer: Option A. -> Ok here
Question 37. Determine Output:
void main()
{
int i=i++, j=j++, k=k++;
printf("%d %d %d", i, j, k);
}
  1.    1 1 1
  2.    0 0 0
  3.    garbage values
  4.    Error
 Discuss Question
Answer: Option C. -> garbage values
Question 38. Determine Output:
void main()
{
static int i=i++, j=j++, k=k++;
printf("%d %d %d", i, j, k);
}
  1.    1 1 1
  2.    0 0 0
  3.    garbage values
  4.    Error
 Discuss Question
Answer: Option A. -> 1 1 1
Question 39. Determine Output:
#define prod(a,b) a*b
void main()
{
int x=3, y=4;
printf("%d", prod(x+2, y-1));
}
  1.    15
  2.    10
  3.    12
  4.    11
 Discuss Question
Answer: Option B. -> 10
Question 40. Determine Output:
void main()
{
char p[]="%dn";
p[1] = 'c';
printf(p, 65);
}
  1.    65
  2.    c
  3.    A
  4.    Error
 Discuss Question
Answer: Option C. -> A

Latest Videos

Latest Test Papers