Sail E0 Webinar

MCQs

Total Questions : 35 | Page 3 of 4 pages
Question 21.


What will be the output of the program?


#include<stdio.h>
int main()
{
char huge *near *far *ptr1;
char near *far *huge *ptr2;
char far *huge *near *ptr3;
printf("%d, %d, %d\n", sizeof(**ptr1), sizeof(ptr2), sizeof(*ptr3));
return 0;
}
  1.    4, 4, 4
  2.    2, 2, 2
  3.    2, 8, 4
  4.    2, 4, 8
 Discuss Question
Answer: Option A. -> 4, 4, 4


Question 22.

What do the following declaration signify?

char *scr;


  1.    scr is a pointer to pointer variable.
  2.    scr is a function pointer.
  3.    scr is a pointer to char.
  4.    scr is a member of function pointer.
 Discuss Question
Answer: Option C. -> scr is a pointer to char.


Question 23.


What will be the output of the program in DOS (Compiler - Turbo C)?


#include<stdio.h>
double i;
int main()
{
(int)(float)(char) i;
printf("%d", sizeof((int)(float)(char)i));
return 0;
}
  1.    1
  2.    2
  3.    4
  4.    8
 Discuss Question
Answer: Option B. -> 2

Due to the C language is being platform dependent:
In Turbo C (DOS - 16 bit platform), the output will be 2. 
But in GCC (Unix/Linux - 32 bit platform), the output will be 4.


Question 24.


What will be the output of the program?


#include<stdio.h>
int main()
{
char far *near *ptr1;
char far *far *ptr2;
char far *huge *ptr3;
printf("%d, %d, %d\n", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
return 0;
}
  1.    4, 4, 8
  2.    4, 4, 4
  3.    2, 4, 4
  4.    2, 4, 8
 Discuss Question
Answer: Option C. -> 2, 4, 4


Question 25.

What do the following declaration signify?

char **argv;


  1.    argv is a pointer to pointer.
  2.    argv is a pointer to a char pointer.
  3.    argv is a function pointer.
  4.    argv is a member of function pointer.
 Discuss Question
Answer: Option B. -> argv is a pointer to a char pointer.


Question 26.

What do the following declaration signify?

void (*cmp)();


  1.    cmp is a pointer to an void function type.
  2.    cmp is a void type pointer function.
  3.    cmp is a function that return a void pointer.
  4.    cmp is a pointer to a function which returns void .
 Discuss Question
Answer: Option D. -> cmp is a pointer to a function which returns void .


Question 27.

What do the following declaration signify?

int *f();


  1.    f is a pointer variable of function type.
  2.    f is a function returning pointer to an int.
  3.    f is a function pointer.
  4.    f is a simple declaration of pointer variable.
 Discuss Question
Answer: Option B. -> f is a function returning pointer to an int.


Question 28.

Declare the following statement?
"A pointer to a function which receives nothing and returns nothing".


  1.    void *(ptr)*int;
  2.    void *(*ptr)()
  3.    void *(*ptr)(*)
  4.    void (*ptr)()
 Discuss Question
Answer: Option D. -> void (*ptr)()


Question 29.

What do the following declaration signify?

void *cmp();


  1.    cmp is a pointer to an void type.
  2.    cmp is a void type pointer variable.
  3.    cmp is a function that return a void pointer.
  4.    cmp function returns nothing.
 Discuss Question
Answer: Option C. -> cmp is a function that return a void pointer.


Question 30.

Declare the following statement?
"A pointer to a function which receives an int pointer and returns float pointer".


  1.    float *(ptr)*int;
  2.    float *(*ptr)(int)
  3.    float *(*ptr)(int*)
  4.    float (*ptr)(int)
 Discuss Question
Answer: Option C. -> float *(*ptr)(int*)


Latest Videos

Latest Test Papers