Skip to main content

C Fundamentals — Part 1 MCQs with Explanations

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

What is the primary purpose of a function prototype in C?

Question 2 of 40

Which character is used to indicate the end of a statement in C?

Question 3 of 40

Which data type is used to represent a single character in C?

Question 4 of 40

What is the correct syntax for declaring a variable in C?

Question 5 of 40

Which symbol is used for the 'modulo' operation in C?

Question 6 of 40

What is the default return type of a function in C if not specified?

Question 7 of 40

Which operator is used for 'logical AND' in C?

Question 8 of 40

What is the purpose of the 'sizeof' operator in C?

Question 9 of 40

In C, which type of variable should be used to store decimal numbers?

Question 10 of 40

Which header file should be included for input and output functions in C?

Question 11 of 40

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

Question 12 of 40

Which of the following is not a valid C keyword?

Question 13 of 40

What is the maximum number of arguments that can be passed to a C function?

Question 14 of 40

Which operator is used to access the value stored at a pointer address in C?

Question 15 of 40

What does the 'void' keyword indicate in a C function declaration?

Question 16 of 40

Which character is used to represent a comment in C code?

Question 17 of 40

What is the purpose of the 'continue' statement in a loop?

Question 18 of 40

What is the range of values that can be stored in an 'int' data type in C?

Question 19 of 40

Which operator is used to compare two values for equality in C?

Question 20 of 40

Which data type is used to store a sequence of characters in C?

Question 21 of 40

In C, which operator is used for pointer-to-pointer relationships?

Question 22 of 40

For 16-bit compiler allowable range for integer constants is ________?

Question 23 of 40

C programs are converted into machine language with the help of

Question 24 of 40

Which one of the following is not a reserved keyword for C?

Question 25 of 40

A C variable cannot start with

Question 26 of 40

Which one of the following is not a valid identifier?

Question 27 of 40

What will be printed after execution of the following program code? main() { printf("\\nab"); printf("\\bsi"); printf("\\rha"); }

Question 28 of 40

If integer needs two bytes of storage, then maximum value of an unsigned integer is

Question 29 of 40

Which of the following is not a correct variable type?

Question 30 of 40

What number would be shown on the screen after the following statements of C are executed? char ch; int i; ch = 'G'; i = ch-'A'; printf("%d", i);

Question 31 of 40

Which of following is not a valid name for a C variable?

Question 32 of 40

Find the output of the following program. void main () { int i=01289; printf ( " %d ", i ) ; }

Question 33 of 40

Find the output of the following program. void main() { int i=065, j=65; printf("%d %d", i, j); }

Question 34 of 40

If ASCII value of 'x' is 120, then what is the value of the H, if H = ('x' – 'w' ) / 3;

Question 35 of 40

short testarray[4][3] = { {1}, {2,3}, {4,5,6}}; printf("%d", sizeof(testarray)); Assuming a short is two bytes long, what will be printed by the above code?

Question 36 of 40

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

Question 37 of 40

What will be the final values of a and c in the following C statement? (Initial values: a = 2, c = 1) c = (c) ? a = 0 : 2;

Question 38 of 40

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

Question 39 of 40

What will be the final values of i and j in the following C code? #include <stdio.h> int x = 0; int f() { if (x == 0) return x + 1; else return x - 1; } int g() { return x++; } int main() { int i = (f() + g()) || g(); int j = g() || (f() + g()); }

Question 40 of 40

What will be the output of the following C code? #include <stdio.h> int main() { printf("Ram\rShyam\n"); return 0; }

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