C-Language Programming MCQs > FREE SET - 1

1. 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)()

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

2. 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.

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

3. 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 .

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

4. What do the following declaration signify?
char **argv;
A argv is a pointer to pointer.
B argv is a pointer to a char pointer.
C argv is a function pointer.
D argv is a member of function pointer.

Free MCQs www.sharemcq.com     Answer: Option B
Explanation:
Available Soon.

5. What do the following declaration signify?
char *scr;
A scr is a pointer to pointer variable.
B scr is a function pointer.
C scr is a pointer to char.
D scr is a member of function pointer.

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

6. What will be the output of the following program?
#include
int main()
{
char far *near *ptr1;
char far *far *ptr2;
char far *huge *ptr3;
printf("%d, %d, %d", sizeof(ptr1), sizeof(ptr2), sizeof(ptr3));
return 0;
}
A 4, 4, 8
B 4, 4, 4
C 2, 4, 4
D 2, 4, 8

Free MCQs www.sharemcq.com     Answer: Option C
Explanation:
Available Soon.

7. Point out the error in the following program.
#include
#include
int main()
{
static char *p = (char *)malloc(10);
return 0;
}
A Error: Lvalue required
B Error: Rvalue required
C Error: invalid *p declaration
D No error

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.

8. Which of the following is a logic gate?
A AND
B OR
C CPU
D AND, OR Both

Free MCQs www.sharemcq.com     Answer: Option D
Explanation:
Available Soon.


No comments:

Post a Comment

Your Feedback is hearty Requested to make the MCQs Collection better.

Popular Posts