Sail E0 Webinar

MCQs

Total Questions : 16 | Page 2 of 2 pages
Question 11.


What will be the output of the program?


#include<stdio.h>
int main()
{
enum color{red, green, blue};
typedef enum color mycolor;
mycolor m = red;
printf("%d", m);
return 0;
}
  1.    1
  2.    0
  3.    2
  4.    red
 Discuss Question
Answer: Option B. -> 0


Question 12.


In the following code, the P2 is Integer Pointer or Integer?


typedef int *ptr;
ptr p1, p2;
  1.    Integer
  2.    Integer pointer
  3.    Error in declaration
  4.    None of above
 Discuss Question
Answer: Option B. -> Integer pointer


Question 13.


In the following code what is 'P'?


typedef char *charp;
const charp P;
  1.    P is a constant
  2.    P is a character constant
  3.    P is character type
  4.    None of above
 Discuss Question
Answer: Option A. -> P is a constant


Question 14.


What is x in the following program?


#include<stdio.h>
int main()
{
typedef char (*(*arrfptr[3])())[10];
arrfptr x;
return 0;
}
  1.    x is a pointer
  2.    x is an array of three pointer
  3.    x is an array of three function pointers
  4.    Error in x declaration
 Discuss Question
Answer: Option C. -> x is an array of three function pointers


Question 15.


What is x in the following program?


#include<stdio.h>
int main()
{
typedef char (*(*arrfptr[3])())[10];
arrfptr x;
return 0;
}
  1.    x is a pointer
  2.    x is an array of three pointer
  3.    x is an array of three function pointers
  4.    Error in x declaration
 Discuss Question
Answer: Option C. -> x is an array of three function pointers



Question 16.


What will be the output of the program?



#include<stdio.h>
int main()
{
typedef float f;
static f *fptr;
float fval = 90;
fptr = &fval;
printf("%f", *fptr);
return 0;
}
  1.    9
  2.    0
  3.    90
  4.    90.000000
 Discuss Question
Answer: Option D. -> 90.000000



Latest Videos

Latest Test Papers