Skip to main content

C Miscellaneous — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on C Miscellaneous — Part 1 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
Content updated Oct 14, 2026
These practice questions are independent study material, not an official commission answer key. ExamHub.pk is reviewing older question sets; check important facts against the relevant commission's syllabus or another primary source. Report a correction.
40

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

Determine output: void main() { int const *p=5; printf("%d", ++(*p)); }

Question 2 of 40

Determine Output: void main() { char s[]="man"; int i; for(i=0; s[i]; i++) printf("%c%c%c%c ", s[i], *(s+i), *(i+s), i[s]); }

Question 3 of 40

Determine Output: void main() { float me = 1.1; double you = 1.1; if(me==you) printf("Condition False"); else printf("Condition True"); }

Question 4 of 40

Determine Output: void main() { static int var = 5; printf("%d ", var--); if(var) main(); }

Question 5 of 40

Determine Output: void main() { char *p; printf("%d %d", sizeof(*p), sizeof(p)); }

Question 6 of 40

Determine the Final Output: void main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

Question 7 of 40

Determine Output: #define int char void main() { int i = 65; printf("sizeof(i)=%d", sizeof(i)); }

Question 8 of 40

Determine Output: void main() { int i=3; switch(i) { default: printf("zero"); case 1: printf("one"); break; case 2: printf("two"); break; case 3: printf("three"); break; } }

Question 9 of 40

Determine Output: void main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s", string); }

Question 10 of 40

Determine Output: void main() { int i=5; printf("%d%d%d%d%d", i++, i--, ++i, --i, i); }

Question 11 of 40

Determine Output: #define square(x) x*x void main() { int i; i = 64/square(4); printf("%d", i); }

Question 12 of 40

Determine Output: void main() { char *p="hi friends", *p1; p1=p; while(*p!='\0') ++*p++; printf("%s", p1); }

Question 13 of 40

Determine Output: #include<stdio.h> #define a 10 void main() { #define a 50 printf("%d", a); }

Question 14 of 40

Determine Output: #define clrscr() 100 void main() { clrscr(); printf("%d", clrscr()); }

Question 15 of 40

Determine Output: void main() { printf("%p", main); }

Question 16 of 40

Determine Output: void main() { char *p; p="Hello"; printf("%c", *&*p); }

Question 17 of 40

Determine Output: void main() { int i=1; while(i<=5) { printf("%d", i); if(i>2) goto here; i++; } } fun() { here: printf("PP"); }

Question 18 of 40

Determine Output: void main() { int i=1, j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

Question 19 of 40

Determine Output: void main() { int i; printf("%d", scanf("%d", &i)); // value 10 is given as input here }

Question 20 of 40

Determine Output: void main() { int i=0; for(;i++;printf("%d", i)); printf("%d", i); }

Question 21 of 40

Determine Output: void main() { struct xx { int x=3; char name[] = "hello"; }; struct xx *s = malloc(sizeof(struct xx)); printf("%d", s->x); printf("%s", s->name); }

Question 22 of 40

Determine output: void main() { extern int i; i=20; printf("%d", sizeof(i)); }

Question 23 of 40

Determine Output: void main() { int i=0, j=0; if(i && j++) printf("%d..%d", i++, j); printf("%d..%d", i, j); }

Question 24 of 40

Determine Output: void main() { static int i=5; if(--i){ main(); printf("%d ", i); } }

Question 25 of 40

Determine Output: void main() { int i=-1, j=-1, k=0, l=2, m; m = i++ && j++ && k++ || l++; printf("%d %d %d %d %d", i, j, k, l, m); }

Question 26 of 40

Determine Output: void main() { int i = -1; +i; printf("i = %d, +i = %d", i, +i); }

Question 27 of 40

Determine Output: void main() { char *str1 = "abcd"; char str2[] = "abcd"; printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd")); }

Question 28 of 40

Determine Output: void main() { char not; not = !2; printf("%d", not); }

Question 29 of 40

Determine Output: #include<stdio.h> void main() { register i=5; char j[]= "hello"; printf("%s %d", j, i); }

Question 30 of 40

Determine Output: void main() { int i=5, j=6, z; printf("%d", i+++j); }

Question 31 of 40

Determine Output: void main() { int i = abc(10); printf("%d", --i); } int abc(int i) { return(i++); }

Question 32 of 40

Determine Output: void main() { char a[]="12345"; int i = strlen(a); printf("%d", ++i); }

Question 33 of 40

Determine Output: void main() { int i; char a[]="�"; if(printf("%sn", a)) printf("Ok here n"); else printf("Forget itn"); }

Question 34 of 40

Determine Output: void main() { int i=i++, j=j++, k=k++; printf("%d %d %d", i, j, k); }

Question 35 of 40

Determine Output: void main() { static int i=i++, j=j++, k=k++; printf("%d %d %d", i, j, k); }

Question 36 of 40

Determine Output: #define prod(a,b) a*b void main() { int x=3, y=4; printf("%d", prod(x+2, y-1)); }

Question 37 of 40

Determine Output: void main() { char p[]="%dn"; p[1] = 'c'; printf(p, 65); }

Question 38 of 40

Determine Output: void main() { char *p; p="%d\n"; p++; p++; printf(p-2, 300); }

Question 39 of 40

Determine Output: void main() { int c[] = {2.8,3.4,4,6.7,5}; int j, *p=c, *q=c; for(j=0;j<5;j++){ printf(" %d ", *c); ++q; } for(j=0;j<5;j++){ printf(" %d ", *p); ++p; } }

Question 40 of 40

Determine Output: void main() { int a[] = {10,20,30,40,50}, j, *p; for(j=0; j<5; j++){ printf("%d" ,*a); a++; } p = a; for(j=0; j<5; j++){ printf("%d" ,*p); p++; } }

✓ Link copied to clipboard

💡 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 the practice question library

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →