Skip to main content

Function — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Function — 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 is the result of the expression abs(-7.5) in C?

Question 2 of 40
★ FPSC ★ PPSC

What will happen after compiling and running following code? main() { printf("%p", main); }

Question 3 of 40
★ FPSC ★ PPSC

Any C program

Question 4 of 40
★ FPSC ★ PPSC

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

Question 5 of 40
★ FPSC ★ PPSC

The default parameter passing mechanism is

Question 6 of 40
★ FPSC ★ PPSC

What is the result of compiling and running this code? main() { char string[] = "Hello World"; display(string); } void display(char *string) { printf("%s", string); }

Question 7 of 40
★ FPSC ★ PPSC

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

Question 8 of 40
★ FPSC ★ PPSC

What will be the output of the following program code? main() { static int var = 5; printf("%d ", var--); if(var) main(); }

Question 9 of 40
★ FPSC ★ PPSC

What will be printed when this program is executed? int f(int x) { if(x <= 4) return x; return f(--x); } void main() { printf("%d ", f(7)); }

Question 10 of 40
★ FPSC ★ PPSC

The recursive functions are executed in a ...........

Question 11 of 40
★ FPSC ★ PPSC

The function scanf() returns .........

Question 12 of 40
★ FPSC ★ PPSC

In C, what is a function primarily used for?

Question 13 of 40
★ FPSC ★ PPSC

What is the result of the expression sqrt(16) in C, assuming proper inclusion of the math library?

Question 14 of 40
★ FPSC ★ PPSC

What is the correct way to declare a function in C that takes no arguments and returns an integer?

Question 15 of 40
★ FPSC ★ PPSC

In C, what is the purpose of the 'return' statement in a function?

Question 16 of 40
★ FPSC ★ PPSC

Which of the following is not a standard C library function for mathematical operations?

Question 17 of 40
★ FPSC ★ PPSC

What is the main advantage of using functions in C?

Question 18 of 40
★ FPSC ★ PPSC

What is a function's return type in C if it does not return any value?

Question 19 of 40
★ FPSC ★ PPSC

In C, what is a function parameter?

Question 20 of 40
★ FPSC ★ PPSC

How is the scope of a local variable defined in C?

Question 21 of 40
★ FPSC ★ PPSC

What is a recursive function in C?

Question 22 of 40
★ FPSC ★ PPSC

What is the result of the expression abs(-5) in C?

Question 23 of 40
★ FPSC ★ PPSC

In C, what is a function definition?

Question 24 of 40
★ FPSC ★ PPSC

What is the purpose of the 'extern' keyword when declaring a function in C?

Question 25 of 40
★ FPSC ★ PPSC

What is the purpose of the 'static' keyword when used with a function in C?

Question 26 of 40
★ FPSC ★ PPSC

In C, what is the purpose of the 'void' keyword as a function return type?

Question 27 of 40
★ FPSC ★ PPSC

How do you call a function named myFunction with two arguments in C?

Question 28 of 40
★ FPSC ★ PPSC

In C, what is a function's prototype?

Question 29 of 40
★ FPSC ★ PPSC

What is the result of the expression floor(5.7) in C, assuming proper inclusion of the math library?

Question 30 of 40
★ FPSC ★ PPSC

In C, what is the purpose of the 'inline' keyword when used with a function?

Question 31 of 40
★ FPSC ★ PPSC

What is a function parameter in C?

Question 32 of 40
★ FPSC ★ PPSC

What is the result of the expression ceil(3.2) in C, assuming proper inclusion of the math library?

Question 33 of 40
★ FPSC ★ PPSC

In C, what is the purpose of the 'const' keyword when used with a function parameter?

Question 34 of 40
★ FPSC ★ PPSC

How can you declare a function in C that takes a variable number of arguments?

Question 35 of 40
★ FPSC ★ PPSC

In C, what is the purpose of the 'recursion' in a function?

Question 36 of 40
★ FPSC ★ PPSC

What is the result of the expression pow(2, 3) in C, assuming proper inclusion of the math library?

Question 37 of 40
★ FPSC ★ PPSC

What is the purpose of the 'volatile' keyword when used with a function in C?

Question 38 of 40
★ FPSC ★ PPSC

In C, what is a function parameter's scope?

Question 39 of 40
★ FPSC ★ PPSC

Use of functions

Question 40 of 40
★ FPSC ★ PPSC

What is function?

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