Practice high-yield Programming & Software Development MCQs on Pointer — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.
Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40
Verified Practice Questions
Interactive test mode with detailed academic worked solutions
Live Progress|0/40 answered
✓0 correct
✗0 wrong
0% score
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the result of the expression *ptr = 42 in C, where ptr is a pointer to an int?
Correct Answer: Option A — Set the value pointed to by ptr to 42
Detailed Academic Explanation:
Set the value pointed to by ptr to 42 is the correct answer to “What is the result of the expression *ptr = 42 in C, where ptr is a pointer to an int”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C, what is a pointer to a function that takes no arguments and returns an integer?
Correct Answer: Option A — int (*ptr)()
Detailed Academic Explanation:
int (*ptr)() is the correct answer to “In C, what is a pointer to a function that takes no arguments and returns an integer”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C, what is a pointer to a constant pointer (int* const)?
Correct Answer: Option B — A pointer that points to a constant pointer
Detailed Academic Explanation:
A pointer that points to a constant pointer is the correct answer to “In C, what is a pointer to a constant pointer (int* const)”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The address operator & , cannot act on
Correct Answer: Option C — Both of the above
Detailed Academic Explanation:
Both of the above is the correct answer to “The address operator & , cannot act on”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The statement int ** a;
Correct Answer: Option C — is syntactically and semantically correct
Detailed Academic Explanation:
is syntactically and semantically correct is the correct answer to “The statement int ** a;”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following program code? #include<stdio.h> void main() { int i = 10; void *p = &i; printf("%f", *(float *)p); }
Correct Answer: Option C — 0.000000
Detailed Academic Explanation:
0.000000 is the correct answer to “What will be the output of the following program code? #include<stdio.h> void main() { int i = 10; void *p = &i; printf("%f", *(float *)p); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The operator > and < are meaningful when used with pointers, if
Correct Answer: Option C — The pointers point to elements of the same array.
Detailed Academic Explanation:
The pointers point to elements of the same array. is the correct answer to “The operator > and < are meaningful when used with pointers, if”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
The declaration int (* p ) [ 5 ] ; means
Correct Answer: Option B — p is a pointer to a 5 elements integer array.
Detailed Academic Explanation:
p is a pointer to a 5 elements integer array. is the correct answer to “The declaration int (* p ) [ 5 ] ; means”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following program code? #include <stdio.h> void main() { int i=3, *j, **k; j = &i; k = &j; printf("%d%d%d", *j, **k, *(*k)); }
Correct Answer: Option C — 333
Detailed Academic Explanation:
333 is the correct answer to “What will be the output of the following program code? #include <stdio.h> void main() { int i=3, *j, **k; j = &i; k = &j; printf("%d%d%d", *j, **k, *(*k)); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is the correct way of declaring a float pointer:
Correct Answer: Option B — float *ptr
Detailed Academic Explanation:
float *ptr is the correct answer to “Which of the following is the correct way of declaring a float pointer:”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Find the output of the following program. void main() { char *msg = "hi"; printf(msg); }
Correct Answer: Option A — hi
Detailed Academic Explanation:
hi is the correct answer to “Find the output of the following program. void main() { char *msg = "hi"; printf(msg); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the base data type of a pointer variable by which the memory would be allocated to it?
Correct Answer: Option E — unsigned int
Detailed Academic Explanation:
unsigned int is the correct answer to “What is the base data type of a pointer variable by which the memory would be allocated to it”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 13 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What would be the output for the following Turbo C code? #include<stdio.h> void main() { int a[]={ 1, 2, 3, 4, 5 }, *p; p=a; ++*p; printf("%d ", *p); p += 2; printf("%d", *p); }
Correct Answer: Option D — 2 3
Detailed Academic Explanation:
2 3 is the correct answer to “What would be the output for the following Turbo C code? #include<stdio.h> void main() { int a[]={ 1, 2, 3, 4, 5 }, *p; p=a; ++*p; printf("%d ", *p); p += 2; printf("%d", *p); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
char* myfunc(char *ptr) { ptr+=3; return(ptr); } void main() { char *x, *y; x = "EXAMVEDA"; y = myfunc(x); printf("y=%s", y); } What will be printed when the sample code above is executed?
Correct Answer: Option C — y=MVEDA
Detailed Academic Explanation:
y=MVEDA is the correct answer to “char* myfunc(char *ptr) { ptr+=3; return(ptr); } void main() { char *x, *y; x = "EXAMVEDA"; y = myfunc(x); printf("y=%s", y); } What will be printed when the sample code above is executed”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
char *ptr; char myString[] = "abcdefg"; ptr = myString; ptr += 5; what string does ptr point to in the sample code above?
Correct Answer: Option A — fg
Detailed Academic Explanation:
fg is the correct answer to “char *ptr; char myString[] = "abcdefg"; ptr = myString; ptr += 5; what string does ptr point to in the sample code above”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> int main() { int i = 10; int *p = &i; foo(&p); printf("%d ", *p); printf("%d ", *p); } void foo(int **const p) { int j = 11; *p = &j; printf("%d ", **p); }
Correct Answer: Option B — 11 11 Undefined-value
Detailed Academic Explanation:
11 11 Undefined-value is the correct answer to “What will be the output of the following C code? #include <stdio.h> int main() { int i = 10; int *p = &i; foo(&p); printf("%d ", *p); printf("%d ", *p); } void foo(int **const p) { int j = 11; *p = &j; printf("%d ", **p); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void main() { char *s= "hello"; char *p = s; printf("%c\t%c", *(p + 3), s[1]); }
Correct Answer: Option D — l e
Detailed Academic Explanation:
l e is the correct answer to “What will be the output of the following C code? #include <stdio.h> void main() { char *s= "hello"; char *p = s; printf("%c\t%c", *(p + 3), s[1]); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void main() { int a[3] = {1, 2, 3}; int *p = a; int **r = &p; printf("%p %p", *r, a); }
Correct Answer: Option C — Same address is printed
Detailed Academic Explanation:
Same address is printed is the correct answer to “What will be the output of the following C code? #include <stdio.h> void main() { int a[3] = {1, 2, 3}; int *p = a; int **r = &p; printf("%p %p", *r, a); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void main() { char *s = "hello"; char *p = s * 3; printf("%c\t%c", *p, s[1]); }
Correct Answer: Option C — Compile time error
Detailed Academic Explanation:
Compile time error is the correct answer to “What will be the output of the following C code? #include <stdio.h> void main() { char *s = "hello"; char *p = s * 3; printf("%c\t%c", *p, s[1]); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following operation is possible using a pointer char? (Assuming the declaration is char *a;)
Correct Answer: Option C — Changing address to point at another location
Detailed Academic Explanation:
Changing address to point at another location is the correct answer to “Which of the following operation is possible using a pointer char? (Assuming the declaration is char *a;)”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Comment on the following C statement. int (*a)[7];
Correct Answer: Option B — A pointer "a" to an array
Detailed Academic Explanation:
A pointer "a" to an array is the correct answer to “Comment on the following C statement. int (*a)[7];”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> int main() { int *p = (int *)2; int *q = (int *)3; printf("%d", p + q); }
Correct Answer: Option D — Compile time error
Detailed Academic Explanation:
Compile time error is the correct answer to “What will be the output of the following C code? #include <stdio.h> int main() { int *p = (int *)2; int *q = (int *)3; printf("%d", p + q); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following statements are true? P. Pointer to Array Q. Multi-dimensional array
Correct Answer: Option C — P are dynamic, Q are static
Detailed Academic Explanation:
P are dynamic, Q are static is the correct answer to “Which of the following statements are true? P. Pointer to Array Q. Multi-dimensional array”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void main() { char *s= "hello"; char *p = s; printf("%c\t%c", p[0], s[1]); }
Correct Answer: Option C — h e
Detailed Academic Explanation:
h e is the correct answer to “What will be the output of the following C code? #include <stdio.h> void main() { char *s= "hello"; char *p = s; printf("%c\t%c", p[0], s[1]); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code (run without any command line arguments)? #include <stdio.h> int main(int argc, char *argv[]) { while (argc--) printf("%s\n", argv[argc]); return 0; }
Correct Answer: Option B — Executablefilename
Detailed Academic Explanation:
Executablefilename is the correct answer to “What will be the output of the following C code (run without any command line arguments)? #include <stdio.h> int main(int argc, char *argv[]) { while (argc--) printf("%s\n", argv[argc]); return 0; }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> int main() { int a[4] = {1, 2, 3, 4}; int *p = &a[1]; int *ptr = &a[2]; ptr = ptr * 1; printf("%d\n", *ptr); }
Correct Answer: Option C — Compile time error
Detailed Academic Explanation:
Compile time error is the correct answer to “What will be the output of the following C code? #include <stdio.h> int main() { int a[4] = {1, 2, 3, 4}; int *p = &a[1]; int *ptr = &a[2]; ptr = ptr * 1; printf("%d\n", *ptr); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void f(char *k) { k++; k[2] = 'm'; } void main() { char s[] = "hello"; f(s); printf("%c\n", *s); }
Correct Answer: Option A — h
Detailed Academic Explanation:
h is the correct answer to “What will be the output of the following C code? #include <stdio.h> void f(char *k) { k++; k[2] = 'm'; } void main() { char s[] = "hello"; f(s); printf("%c\n", *s); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is not possible statically in C?
Correct Answer: Option A — Jagged Array
Detailed Academic Explanation:
Jagged Array is the correct answer to “Which of the following is not possible statically in C”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> int main() { int i = 10; void *p = &i; printf("%d\n", (int)*p); return 0; }
Correct Answer: Option A — Compile time error
Detailed Academic Explanation:
Compile time error is the correct answer to “What will be the output of the following C code? #include <stdio.h> int main() { int i = 10; void *p = &i; printf("%d\n", (int)*p); return 0; }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void main() { char *a[10] = {"hi", "hello", "how"}; int i = 0; for (i = 0;i < 10; i++) printf("%s", *(a[i])); }
Correct Answer: Option A — segmentation fault
Detailed Academic Explanation:
segmentation fault is the correct answer to “What will be the output of the following C code? #include <stdio.h> void main() { char *a[10] = {"hi", "hello", "how"}; int i = 0; for (i = 0;i < 10; i++) printf("%s", *(a[i])); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> int main() { const int ary[4] = {1, 2, 3, 4}; int *p; p = ary + 3; *p = 5; printf("%d\n", ary[3]); }
Correct Answer: Option B — 5
Detailed Academic Explanation:
5 is the correct answer to “What will be the output of the following C code? #include <stdio.h> int main() { const int ary[4] = {1, 2, 3, 4}; int *p; p = ary + 3; *p = 5; printf("%d\n", ary[3]); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void foo( int[] ); int main() { int ary[4] = {1, 2, 3, 4}; foo(ary); printf("%d ", ary[0]); } void foo(int p[4]) { int i = 10; p = &i; printf("%d ", p[0]); }
Correct Answer: Option C — 10 1
Detailed Academic Explanation:
10 1 is the correct answer to “What will be the output of the following C code? #include <stdio.h> void foo( int[] ); int main() { int ary[4] = {1, 2, 3, 4}; foo(ary); printf("%d ", ary[0]); } void foo(int p[4]) { int i = 10; p = &i; printf("%d ", p[0]); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How to call a function without using the function name to send parameters?
Correct Answer: Option B — Function pointer
Detailed Academic Explanation:
Function pointer is the correct answer to “How to call a function without using the function name to send parameters”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void main() { int a[3] = {1, 2, 3}; int *p = a; printf("%p\t%p", p, a); }
Correct Answer: Option A — Same address is printed
Detailed Academic Explanation:
Same address is printed is the correct answer to “What will be the output of the following C code? #include <stdio.h> void main() { int a[3] = {1, 2, 3}; int *p = a; printf("%p\t%p", p, a); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Comment on an array of the void data type.
Correct Answer: Option D — You cannot have an array of void data type
Detailed Academic Explanation:
You cannot have an array of void data type is the correct answer to “Comment on an array of the void data type.”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the syntax for constant pointer to address (i.e., fixed pointer address)?
Correct Answer: Option B — <type> * const <name>
Detailed Academic Explanation:
<type> * const <name> is the correct answer to “What is the syntax for constant pointer to address (i.e., fixed pointer address)”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code (run without any command line arguments)? #include <stdio.h> int main(int argc, char *argv[]) { while (*argv != NULL) printf("%s\n", *(argv++)); return 0; }
Correct Answer: Option B — Executable file name
Detailed Academic Explanation:
Executable file name is the correct answer to “What will be the output of the following C code (run without any command line arguments)? #include <stdio.h> int main(int argc, char *argv[]) { while (*argv != NULL) printf("%s\n", *(argv++)); return 0; }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> void m(int *p) { int i = 0; for(i = 0;i < 5; i++) printf("%d\t", p[i]); } void main() { int a[5] = {6, 5, 3}; m(&a); }
Correct Answer: Option B — 6 5 3 0 0
Detailed Academic Explanation:
6 5 3 0 0 is the correct answer to “What will be the output of the following C code? #include <stdio.h> void m(int *p) { int i = 0; for(i = 0;i < 5; i++) printf("%d\t", p[i]); } void main() { int a[5] = {6, 5, 3}; m(&a); }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the first argument in command line arguments?
Correct Answer: Option A — The number of command-line arguments the program was invoked with
Detailed Academic Explanation:
The number of command-line arguments the program was invoked with is the correct answer to “What is the first argument in command line arguments”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> int main() { int i = 0, j = 1; int *a[] = {&i, &j}; printf("%d", (*a)[1]); return 0; }
Correct Answer: Option D — Some garbage value
Detailed Academic Explanation:
Some garbage value is the correct answer to “What will be the output of the following C code? #include <stdio.h> int main() { int i = 0, j = 1; int *a[] = {&i, &j}; printf("%d", (*a)[1]); return 0; }”. This question is standard in competitive examination syllabi for Pointer.
💡Key Conceptual Anchor:Pointer
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡Examiner's Advisory for Programming & Software Development
In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.