Skip to main content

C Fundamentals — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on C Fundamentals — 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

String handling functions such as strcmp(), strcpy() etc can be used with enumerated types.

Question 2 of 40
★ FPSC ★ PPSC

What does the 'NULL' keyword represent in C?

Question 3 of 40
★ FPSC ★ PPSC

Which library function is used to allocate memory dynamically in C?

Question 4 of 40
★ FPSC ★ PPSC

What is the purpose of the 'scanf' function in C?

Question 5 of 40
★ FPSC ★ PPSC

What is the purpose of the 'goto' statement in C?

Question 6 of 40
★ FPSC ★ PPSC

Which header file is used for mathematical functions in C?

Question 7 of 40
★ FPSC ★ PPSC

What is the significance of the 'volatile' keyword in C?

Question 8 of 40
★ FPSC ★ PPSC

Who is father of C Language?

Question 9 of 40
★ FPSC ★ PPSC

C Language developed at _________?

Question 10 of 40
★ FPSC ★ PPSC

C was primarily developed as

Question 11 of 40
★ FPSC ★ PPSC

Standard ANSI C recognizes ______ number of keywords?

Question 12 of 40
★ FPSC ★ PPSC

What is the correct value to return to the operating system upon the successful completion of a program?

Question 13 of 40
★ FPSC ★ PPSC

Which is the only function all C programs must contain?

Question 14 of 40
★ FPSC ★ PPSC

What is the difference between a declaration and a definition of a variable?

Question 15 of 40
★ FPSC ★ PPSC

"My salary was increased by 15%" Select the statement, which will EXACTLY reproduce the line of text above.

Question 16 of 40
★ FPSC ★ PPSC

Will the following C code compile without any error? #include <stdio.h> int main() { for (int k = 0; k < 10; k++); return 0; }

Question 17 of 40
★ FPSC ★ PPSC

Variable name resolution (number of significant characters for the uniqueness of variable) depends on . . . . . . . .

Question 18 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> int main() { unsigned int a = 10; a = ~a; printf("%d\n", a); }

Question 19 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> int main() { int a = 1, b = 2; a += b -= a; printf("%d %d", a, b); }

Question 20 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> void main() { int x = 1, y = 0, z = 5; int a = x && y || z++; printf("%d", z); }

Question 21 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> int main() { int a = 1, b = 1, d = 1; printf("%d, %d, %d", ++a + ++a+a++, a++ + ++b, ++d + d++ + a++); }

Question 22 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> int main() { int i = 2; int j = ++i + i; printf("%d\n", j); }

Question 23 of 40
★ FPSC ★ PPSC

What will be the final value of j in the following C code? #include <stdio.h> int main() { int i = 10, j = 0; if (i || (j = i + 10)) //do something ; }

Question 24 of 40
★ FPSC ★ PPSC

What will be the output of the following C function? #include <stdio.h> enum birds {SPARROW, PEACOCK, PARROT}; enum animals {TIGER = 8, LION, RABBIT, ZEBRA}; int main() { enum birds m = TIGER; int k; k = m; printf("%d\n", k); return 0; }

Question 25 of 40
★ FPSC ★ PPSC

What is the size of an int data type?

Question 26 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> void main() { int k = 8; int m = 7; int z = k < m ? k++ : m++; printf("%d", z); }

Question 27 of 40
★ FPSC ★ PPSC

Pick the incorrect statement with respect to enums.

Question 28 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> int main() { int x = 2, y = 0; int z; z = (y++, y); printf("%d\n", z); return 0; }

Question 29 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> int main() { int x = 1, y = 0; x &&= y; printf("%d\n", x); }

Question 30 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> void main() { int a = 5 * 3 % 6 - 8 + 3; printf("%d", a); }

Question 31 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> void main() { float x = 0.1; if (x == 0.1) printf("India"); else printf("Advanced C Classes"); }

Question 32 of 40
★ FPSC ★ PPSC

What will be the final value of j in the following C code? #include <stdio.h> int main() { int i = 0, j = 0; if (i && (j = i + 10)) //do something ; }

Question 33 of 40
★ FPSC ★ PPSC

Will the following C code compile without any error? #include <stdio.h> int main() { int k; { int k; for (k = 0; k < 10; k++); } }

Question 34 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> int main() { int a = 4, n, i, result = 0; scanf("%d", &n); for (i = 0;i < n; i++) result += a; }

Question 35 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include<stdio.h> enum hello { a,b=99,c,d=-1 }; main() { enum hello m; printf("%d\n%d\n%d\n%d\n",a,b,c,d); }

Question 36 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> int main() { j = 10; printf("%d\n", j++); return 0; }

Question 37 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> #define MAX 2 enum bird {SPARROW = MAX + 1, PARROT = SPARROW + MAX}; int main() { enum bird b = PARROT; printf("%d\n", b); return 0; }

Question 38 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include<stdio.h> enum shyam { a=2,b=3.56 }; enum shyam s; main() { printf("%d%d",a,b); }

Question 39 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <stdio.h> int main() { int a[5] = {1, 2, 3, 4, 5}; int i; for (i = 0; i < 5; i++) if ((char)a[i] == '5') printf("%d\n", a[i]); else printf("FAIL\n"); }

Question 40 of 40
★ FPSC ★ PPSC

One of the major difference between typedef and #define is that typedef interpretation is performed by the . . . . . . . . whereas #define interpretation is performed by the . . . . . . . .

✓ 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 →