Skip to main content

Pointer — Part 2 MCQs with Explanations

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
Question 1 of 40
★ FPSC ★ PPSC

What is the result of the expression *ptr = 42 in C, where ptr is a pointer to an int?

Question 2 of 40
★ FPSC ★ PPSC

In C, what is a pointer to a function that takes no arguments and returns an integer?

Question 3 of 40
★ FPSC ★ PPSC

In C, what is a pointer to a constant pointer (int* const)?

Question 4 of 40
★ FPSC ★ PPSC

The address operator & , cannot act on

Question 5 of 40
★ FPSC ★ PPSC

The statement int ** a;

Question 6 of 40
★ 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); }

Question 7 of 40
★ FPSC ★ PPSC

The operator > and < are meaningful when used with pointers, if

Question 8 of 40
★ FPSC ★ PPSC

The declaration int (* p ) [ 5 ] ; means

Question 9 of 40
★ 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)); }

Question 10 of 40
★ FPSC ★ PPSC

Which of the following is the correct way of declaring a float pointer:

Question 11 of 40
★ FPSC ★ PPSC

Find the output of the following program. void main() { char *msg = "hi"; printf(msg); }

Question 12 of 40
★ FPSC ★ PPSC

What is the base data type of a pointer variable by which the memory would be allocated to it?

Question 13 of 40
★ 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); }

Question 14 of 40
★ 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?

Question 15 of 40
★ FPSC ★ PPSC

char *ptr; char myString[] = "abcdefg"; ptr = myString; ptr += 5; what string does ptr point to in the sample code above?

Question 16 of 40
★ 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); }

Question 17 of 40
★ 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]); }

Question 18 of 40
★ 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); }

Question 19 of 40
★ 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]); }

Question 20 of 40
★ FPSC ★ PPSC

Which of the following operation is possible using a pointer char? (Assuming the declaration is char *a;)

Question 21 of 40
★ FPSC ★ PPSC

Comment on the following C statement. int (*a)[7];

Question 22 of 40
★ 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); }

Question 23 of 40
★ FPSC ★ PPSC

Which of the following statements are true? P. Pointer to Array Q. Multi-dimensional array

Question 24 of 40
★ 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]); }

Question 25 of 40
★ 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; }

Question 26 of 40
★ 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); }

Question 27 of 40
★ 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); }

Question 28 of 40
★ FPSC ★ PPSC

Which of the following is not possible statically in C?

Question 29 of 40
★ 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; }

Question 30 of 40
★ 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])); }

Question 31 of 40
★ 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]); }

Question 32 of 40
★ 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]); }

Question 33 of 40
★ FPSC ★ PPSC

How to call a function without using the function name to send parameters?

Question 34 of 40
★ 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); }

Question 35 of 40
★ FPSC ★ PPSC

Comment on an array of the void data type.

Question 36 of 40
★ FPSC ★ PPSC

What is the syntax for constant pointer to address (i.e., fixed pointer address)?

Question 37 of 40
★ 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; }

Question 38 of 40
★ 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); }

Question 39 of 40
★ FPSC ★ PPSC

What is the first argument in command line arguments?

Question 40 of 40
★ 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; }

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

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

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →