C Programming 19

COEP
Lets Crack Online Exam

IT Interview Exam Questions: C Programming 19 (IT Interview Exam Question, IT Campus Placement)

Subject: C Programming 19

Part 19: List for questions and answers of C Language

 

Q1. Declare the following statement? “an array of three pointers to chars”

a) Char *ptr[3]();

b) char *ptr[3];

c) Char (*ptr[3])();

d) Char **ptr[3];

 

Q2. What do the following declaration signify? Int *ptr[30];

a) Ptr is a pointer to an array of 30 integer pointers

b) ptr is a array of 30 pointers to integers

c) Ptr is a array of 30 integer pointers

d) Ptr is a array 30 pointers

 

Q3. Declare the following statement? “a pointer to an array of three chars”

a) Char *ptr[3]();

b) Char (*ptr)*[3];

c) Char (*ptr[3])();

d) char (*ptr)[3];

 

Q4. What do the following declaration signify? Char *arr[10];

a) arr is a array of 10 character pointers

b) Arr is a array of function pointer

c) Arr is a array of characters

d) Arr is a pointer to array of characters

 

Q5. What do the following declaration signify? Int (*pf)();

a) Pf is a pointer to function

b) Pf is a function pointer

c) pf is a pointer to a function which return int

d) Pf is a function of pointer variable

 

Q6. Declare the following statement? “a pointer to a function which receives an int pointer and returns float pointer”

a) Float *(ptr)*int;

b) Float *(*ptr)(int)

c) float *(*ptr)(int*)

d) Float (*ptr)(int) 

 

Q7. What do the following declaration signify? Void *cmp();

a) Cmp is a pointer to an void type

b) Cmp is a void type pointer variable

c) cmp is a function that return a void pointer

d) Cmp function returns nothing

 

Q8. Declare the following statement? “a pointer to a function which receives nothing and returns nothing”

a) Void *(ptr)*int;

b) Void *(*ptr)()

c) Void *(*ptr)(*)

d) void (*ptr)()

 

Q9. What do the following declaration signify? Int *f();

a) F is a pointer variable of function type

b) f is a function returning pointer to an int

c) F is a function pointer

d) F is a simple declaration of pointer variable

 

Q10. What do the following declaration signify? Void (*cmp)();

a) Cmp is a pointer to an void function type

b) Cmp is a void type pointer function

c) Cmp is a function that return a void pointer

d) cmp is a pointer to a function which returns void

 

Q11. 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; 

}

a) 4, 4, 8

b) 4, 4, 4

c) 2, 4, 4

d) 2, 4, 8

 

Q12. What will be the output of the program in dos (compiler – turbo c)? Double i;

#include <stdio.h>

   int main() 

    (int)(float)(char) i; 

     printf(“%d”, sizeof((int)(float)(char)i));

    return 0; 

}

a) 1

b) 2

c) 4

d) 8 

 

Q13. 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;

}

a) 4, 4, 4

b) 2, 2, 2

c) 2, 8, 4

d) 2, 4, 8

 

Q14. What will be the output ?

#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;

}

a) 4, 4, 8

b) 2, 4, 4

c) 4, 4, 2

d) 2, 4, 8

 

Q15. What will be the output of the program? 

#include<stdio.h>

typedef void v;

typedef int i;

int main()

{

   v fun(i, i);

    fun(2, 3);

    return 0;

}

v fun(i a, i b)

{

    i s=2;

    float i;

    printf(“%d,”, sizeof(i));

    printf(” %d”, a*b*s);

}

a) 2, 8

b) 4, 8

c) 2, 4

d) 4, 12

 

Q16. The number of possible values of m, such that m & 0x3f equals 0x23 is

a) 1

b) 2

c) 3

d) 4

 

Q17. Cb is a

a) c code beautifying tool

b) C interpreter

c) C compiler

d) None of the above 

 

Q18. In what kind of structure for strings, one can easily insert, delete, concatenate and rearrange sustrings?

a) Fixed length storage structure

b) Variable length storage with fixed maximum

c) linked list storage

d) Relocatable structure

 

Q19. If space occupied by a null terminated string “s1” and “s2″in “c” are respectively “m” and “n”,the space occupied by the string obtained by concentrating “s1″and “s2″is always

a) less than m+n

b) Equal to m+n

c) Greater than m+n

d) Equal to m*n

 

Q20. If space occupied by two strings s1 and s2 in ‘c’ are respectively m and n, then space occupied by string obtained by concatenating s1a nd s2is always

a) less than m+n

b) Equal to m+n

c) Greater than m+n

d) Greater them m*n 

 

Part 19: List for questions and answers of C Language

 

Q1. Answer: b

 

Q2. Answer: b

 

Q3. Answer: d

 

Q4. Answer: a

 

Q5. Answer: c

 

Q6. Answer: c

 

Q7. Answer: c

 

Q8. Answer: d

 

Q9. Answer: b

 

Q10. Answer: d

 

Q11. Answer: c

 

Q12. Answer: b

 

Q13. Answer: a

 

Q14. Answer: c

 

Q15. Answer: d

 

Q16. Answer: d

 

Q17. Answer: a

 

Q18. Answer: c

 

Q19. Answer: a

 

Q20. Answer: a