Skip to main content

Functions And Methods In C Sharp — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Functions And Methods In C Sharp — 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 keyword used to define a function in C#?

Question 2 of 40
★ FPSC ★ PPSC

What is the purpose of a return type in a method declaration in C#?

Question 3 of 40
★ FPSC ★ PPSC

In C#, which keyword is used to define a method that does not return a value?

Question 4 of 40
★ FPSC ★ PPSC

What is the correct syntax to declare a method named Add that takes two integer parameters and returns their sum in C#?

Question 5 of 40
★ FPSC ★ PPSC

Which of the following statements is true regarding method overloading in C#?

Question 6 of 40
★ FPSC ★ PPSC

What is the purpose of the params keyword in C# method parameters?

Question 7 of 40
★ FPSC ★ PPSC

What is the access modifier used to define a method that can be accessed from any class in the same assembly in C#?

Question 8 of 40
★ FPSC ★ PPSC

Which of the following is NOT a valid parameter passing mechanism in C#?

Question 9 of 40
★ FPSC ★ PPSC

What is the correct way to call a method named CalculateArea with parameters width and height in C#?

Question 10 of 40
★ FPSC ★ PPSC

What is the result of the expression Math.Max(10, 20) in C#?

Question 11 of 40
★ FPSC ★ PPSC

What is the purpose of the out keyword in C# method parameters?

Question 12 of 40
★ FPSC ★ PPSC

In C#, which keyword is used to exit from a method without returning any value?

Question 13 of 40
★ FPSC ★ PPSC

What is the correct way to define a method named PrintMessage that does not take any parameters and does not return any value in C#?

Question 14 of 40
★ FPSC ★ PPSC

What is the purpose of method parameters in C#?

Question 15 of 40
★ FPSC ★ PPSC

What is the correct way to define a method named GetSquare that takes an integer parameter num and returns its square in C#?

Question 16 of 40
★ FPSC ★ PPSC

What is the purpose of the static keyword when applied to a method in C#?

Question 17 of 40
★ FPSC ★ PPSC

What is the correct way to define a method named CalculateSum that takes two integers as parameters and returns their sum in C#?

Question 18 of 40
★ FPSC ★ PPSC

In C#, which access modifier is used to restrict access to a method within the same class or derived classes?

Question 19 of 40
★ FPSC ★ PPSC

What is the return type of a method that does not return any value in C#?

Question 20 of 40
★ FPSC ★ PPSC

In C#, which keyword is used to define a method that belongs to a class and can be called without creating an instance of the class?

Question 21 of 40
★ FPSC ★ PPSC

What is the result of the expression Math.Round(4.5) in C#?

Question 22 of 40
★ FPSC ★ PPSC

What is the correct syntax to declare a method named PrintMessage that prints a message to the console without returning any value in C#?

Question 23 of 40
★ FPSC ★ PPSC

In C#, which keyword is used to define a method that cannot be overridden in derived classes?

Question 24 of 40
★ FPSC ★ PPSC

What is the purpose of method overloading in C#?

Question 25 of 40
★ FPSC ★ PPSC

What is the correct way to declare a method named GetAbsoluteValue that takes an integer parameter num and returns its absolute value in C#?

Question 26 of 40
★ FPSC ★ PPSC

In C#, which method is used to convert a string representation of a number to its integer equivalent?

Question 27 of 40
★ FPSC ★ PPSC

What is the correct syntax to define a method named CalculateArea that calculates the area of a rectangle with length and width parameters in C#?

Question 28 of 40
★ FPSC ★ PPSC

In C#, which keyword is used to define a method that can be overridden in derived classes?

Question 29 of 40
★ FPSC ★ PPSC

What is the correct way to call a method named PrintName with a string parameter name in C#?

Question 30 of 40
★ FPSC ★ PPSC

Which of the following access modifiers allows a method to be accessed only within the same assembly in C#?

Question 31 of 40
★ FPSC ★ PPSC

What is the result of the expression Math.Floor(4.6) in C#?

Question 32 of 40
★ FPSC ★ PPSC

What is the correct way to define a method named IsEven that takes an integer parameter num and returns true if the number is even, otherwise false, in C#?

Question 33 of 40
★ FPSC ★ PPSC

In C#, which keyword is used to define a method that is implemented in a derived class to provide a specific implementation for a method defined in the base class?

Question 34 of 40
★ FPSC ★ PPSC

What is the correct way to declare a method named PrintMessage that prints a message to the console without taking any parameters or returning any value in C#?

Question 35 of 40
★ FPSC ★ PPSC

In C#, which method is used to convert a string to its uppercase equivalent?

Question 36 of 40
★ FPSC ★ PPSC

What is the correct syntax to define a method named CalculateAverage that calculates the average of an array of integers in C#?

Question 37 of 40
★ FPSC ★ PPSC

What is the return type of the IndexOf() method when applied to a string in C#?

Question 38 of 40
★ FPSC ★ PPSC

What is the correct syntax to define a method named GetMax that takes two integer parameters num1 and num2 and returns the maximum of the two numbers in C#?

Question 39 of 40
★ FPSC ★ PPSC

Which of these methods is executed first before execution of any other thing that takes place in a program?

Question 40 of 40
★ FPSC ★ PPSC

Which of these can be used to differentiate two or more methods having same name?

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