Skip to main content

C Preprocessor — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on C Preprocessor — 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
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 will be the output of the program? #include<stdio.h> #define int char void main() { int i = 65; printf("sizeof(i)=%d", sizeof(i)); }

Question 2 of 40
★ FPSC ★ PPSC

What will be the output of the following program? #include<stdio.h> #define square(x) x*x void main() { int i; i = 64/square(4); printf("%d", i); }

Question 3 of 40
★ FPSC ★ PPSC

What will be the output of the program code? #include<stdio.h> #define a 10 void main() { #define a 50 printf("%d", a); }

Question 4 of 40
★ FPSC ★ PPSC

Determine output: #include<stdio.h> #define clrscr() 100 void main() { clrscr(); printf("%dn", clrscr()); }

Question 5 of 40
★ FPSC ★ PPSC

What will be the output of the following program? #include<stdio.h> #define prod(a,b) a*b void main() { int x=3,y=4; printf("%d", prod(x+2,y-1)); }

Question 6 of 40
★ FPSC ★ PPSC

What will be output if you will compile and execute the following c code? #include<stdio.h> #define max 5 void main(){ int i = 0; i = max++; printf("%d", i++); }

Question 7 of 40
★ FPSC ★ PPSC

The output of the following program is: #define f(g,g2) g##g2 void main() { int var12=100; printf("%d", f(var,12)); }

Question 8 of 40
★ FPSC ★ PPSC

Find the output of the following program. #define INC(X) X++ void main() { int x=4; printf("%d", INC(x++)); }

Question 9 of 40
★ FPSC ★ PPSC

What is the purpose of the C preprocessor in C programming?

Question 10 of 40
★ FPSC ★ PPSC

Which directive is used to include the contents of another file in a C program using the C preprocessor?

Question 11 of 40
★ FPSC ★ PPSC

What is the purpose of the #define directive in C preprocessing?

Question 12 of 40
★ FPSC ★ PPSC

In C, which directive is used to conditionally include code based on preprocessor macros?

Question 13 of 40
★ FPSC ★ PPSC

What is the result of the #ifdef DEBUG directive if the DEBUG macro is defined?

Question 14 of 40
★ FPSC ★ PPSC

Which directive in C preprocessing is used to define a macro with parameters?

Question 15 of 40
★ FPSC ★ PPSC

In C preprocessing, what is the purpose of the #undef directive?

Question 16 of 40
★ FPSC ★ PPSC

What does the #ifndef directive do in C preprocessing?

Question 17 of 40
★ FPSC ★ PPSC

In C, what does the #pragma directive do in C preprocessing?

Question 18 of 40
★ FPSC ★ PPSC

What is the purpose of the #include directive in C preprocessing?

Question 19 of 40
★ FPSC ★ PPSC

What is the purpose of the #if directive in C preprocessing?

Question 20 of 40
★ FPSC ★ PPSC

In C, how do you use the #ifdef directive to conditionally include code if a macro is defined?

Question 21 of 40
★ FPSC ★ PPSC

What is the purpose of the #error directive in C preprocessing?

Question 22 of 40
★ FPSC ★ PPSC

What is the result of the #ifndef DEBUG directive if the DEBUG macro is defined?

Question 23 of 40
★ FPSC ★ PPSC

Which directive in C preprocessing is used to concatenate two or more strings?

Question 24 of 40
★ FPSC ★ PPSC

In C, what does the #line directive do in C preprocessing?

Question 25 of 40
★ FPSC ★ PPSC

What is the purpose of the #pragma once directive in C preprocessing?

Question 26 of 40
★ FPSC ★ PPSC

In C preprocessing, what is the purpose of the #elif directive?

Question 27 of 40
★ FPSC ★ PPSC

What is the result of the #error directive in C preprocessing?

Question 28 of 40
★ FPSC ★ PPSC

What is the purpose of the #pragma message directive in C preprocessing?

Question 29 of 40
★ FPSC ★ PPSC

In C, how do you use the #ifndef directive to conditionally include code if a macro is not defined?

Question 30 of 40
★ FPSC ★ PPSC

What does the #pragma once directive do in C preprocessing?

Question 31 of 40
★ FPSC ★ PPSC

In C, what is the purpose of the #ifdef directive?

Question 32 of 40
★ FPSC ★ PPSC

What is the purpose of the #pragma warning directive in C preprocessing?

Question 33 of 40
★ FPSC ★ PPSC

In C preprocessing, what is the purpose of the #elifdef directive?

Question 34 of 40
★ FPSC ★ PPSC

What is the result of the #pragma message directive in C preprocessing?

Question 35 of 40
★ FPSC ★ PPSC

What is the purpose of the #undef directive in C preprocessing?

Question 36 of 40
★ FPSC ★ PPSC

In C preprocessing, what is the purpose of the #elifndef directive?

Question 37 of 40
★ FPSC ★ PPSC

What is the result of the #pragma warning directive in C preprocessing?

Question 38 of 40
★ FPSC ★ PPSC

In C, what is the purpose of the #line directive?

Question 39 of 40
★ FPSC ★ PPSC

C preprocessor

Question 40 of 40
★ FPSC ★ PPSC

A preprocessor command

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