Programming for Problem Solving (3110003) MCQs

MCQs of Pointers

Showing 1 to 10 out of 25 Questions
1.
If ptr is a pointer to int, having value ptr=100. After ptr++, what is the value of ptr?
(a) 100
(b) 101
(c) 102
(d) 103
Answer:

Option (c)

2.
A Pointer is?
(a) A keyword used to create variables.
(b) A variable that stores address of an instruction.
(c) A variable that stores address of other variable.
(d) All of above
Answer:

Option (c)

3.
A pointer value refers to
(a) A float value
(b) An integer constant
(c) Any valid address in memory
(d) None
Answer:

Option (c)

4.
Pointer variable is declared using preceding _________ sign
(a) %
(b) &
(c) *
(d) ^
Answer:

Option (c)

5.
Address stored in the pointer variable is of type ________
(a) Integer
(b) Floating
(c) Hexadecimal
(d) Character
Answer:

Option (a)

6.
Consider the 32 bit compiler. We need to store address of integer variable to integer pointer. What will be the size of integer pointer?
(a) 6 Bytes
(b) 2 Bytes
(c) 4 Bytes
(d) 10 Bytes
Answer:

Option (b)

7.
In order to fetch the address of the variable we write preceding _________ sign before variable name.
(a) Percent (%)
(b) Ampersand (&)
(c) Comma (,)
(d) Asterik (*)
Answer:

Option (b)

8.
"&" is called as ___________ in pointer concept
(a) Conditional operator
(b) Logical operator
(c) Address operator
(d) None of these
Answer:

Option (c)

9.
"*" is called as __________
(a) Value at operator
(b) Scope resolution operator
(c) Address operator
(d) None of these
Answer:

Option (a)

10.
What is the output?

void main()
{
    int *pc, c;
    c = 5;
    pc = &c;
    printf("%d", *pc);
}

(a) Address of c
(b) 5
(c) Address of pc
(d) Error
Answer:

Option (b)

Showing 1 to 10 out of 25 Questions