Sail E0 Webinar

MCQs

Total Questions : 45 | Page 5 of 5 pages
Question 41. Determine Output:
void main()
{
char *p;
p="%d\n";
p++;
p++;
printf(p-2, 300);
}
  1.    %d\n
  2.    300
  3.    Error
  4.    None of These
 Discuss Question
Answer: Option B. -> 300
Question 42. Determine Output:
void main()
{
int c[] = {2.8,3.4,4,6.7,5};
int j, *p=c, *q=c;
for(j=0;j
  1.    2 3 4 6 5 2 3 4 6 5
  2.    2.8 3.4 4 6.7 5 2.8 3.4 4 6.7
  3.    2.8 2.8 2.8 2.8 2.8 2.8 3.4 4
  4.    2 2 2 2 2 2 3 4 6 5
 Discuss Question
Answer: Option D. -> 2 2 2 2 2 2 3 4 6 5
Question 43. Determine Output:
void main()
{
int a[] = {10,20,30,40,50}, j, *p;
for(j=0; j
  1.    10 20 30 40 50 10 20 30 40 50
  2.    10 20 30 40 50 Garbage Value
  3.    Error
  4.    None of These
 Discuss Question
Answer: Option C. -> Error
Question 44. Determine Output:
void main()
{
static char *s[] = {"black", "white", "yellow", "violet"};
char **ptr[] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
++p;
printf("%s",*--*++p + 3);
}
  1.    te
  2.    ow
  3.    et
  4.    ck
 Discuss Question
Answer: Option D. -> ck
Question 45. Determine Output:
#include
void main()
{
char s[]={'a','b','c','n','c','\0'};
char *p, *str, *str1;
p=&s[3];
str=p;
str1=s;
printf("%c", ++*p + ++*str1-32);
}
  1.    N
  2.    P
  3.    M
  4.    None of These
 Discuss Question
Answer: Option C. -> M

Latest Videos

Latest Test Papers