Operators And Expressions — Part 2 MCQs with Explanations
Practice high-yield Programming & Software Development MCQs on Operators And Expressions — 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
🎉 Set complete! All 40 questions answered.
Question 1 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Find the output of the following program. #include<stdio.h> void main() { int y=10; if(y++>9 && y++!=11 && y++>11) printf("%d", y); else printf("%d", y); }
Correct Answer: Option B — 12
Detailed Academic Explanation:
Since the second condition is false so, further conditions will not be checked, it will be skipped.
💡Key Conceptual Anchor:Operators And Expressions
Question 2 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Choose the correct output for the following program. #include<stdio.h> void main() { int a=10, b=11, c=13, d; d = (a=c, b+=a, c=a+b+c); printf("%d %d %d %d", d, a, b, c); }
Correct Answer: Option B — 50, 13, 24, 50
Detailed Academic Explanation:
For any comma separated expression the outcome is the right most part.
💡Key Conceptual Anchor:Operators And Expressions
Question 3 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which operator from the following has the lowest priority?
Correct Answer: Option C — Comma operator
Detailed Academic Explanation:
C Operator Precedence Table
💡Key Conceptual Anchor:Operators And Expressions
Question 4 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Identify the correct output of the following code: void main() { int w=10, x=5, y=3, z=3; if( (w < x ) && (y=z++) ) printf("%d %d %d %d", w, x, y, z); else printf("%d %d %d %d", w, x, y, z); }
Correct Answer: Option B — 10 5 3 3
Detailed Academic Explanation:
As the first condition ( w < x) is false and the logical operator && is used, the entire relation becomes false and the second part ( y = z++) is not executed.
💡Key Conceptual Anchor:Operators And Expressions
Question 5 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Given b=110 and c=20 , what is the value of 'a' after execution of the expression a=b-=c*=5?
Correct Answer: Option B — 10
Detailed Academic Explanation:
As the expression is evaluated from right to left.
💡Key Conceptual Anchor:Operators And Expressions
Question 6 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
what will be the output when following code is executed? void main() { int a=10, b; b = a++ + ++a; printf("%d %d %d %d", b, a++, a, ++a); }
Correct Answer: Option E — 22 13 14 14
Detailed Academic Explanation:
Step 1: Initialize a with the value 10. Step 2: Declare b without initialization (the initial value is undefined). Step 3: Evaluate a++ (post-increment): - The current value of a is 10. - After evaluating a++ , a becomes 11. Step 4: Evaluate ++a (pre-increment): - ++a increments a to 12 and returns the updated value, which is 12. Step 5: Sum the values obtained in steps 3 and 4: 10 + 12 equals 22. Step 6: Assign the sum (22) to b . Step 7: The printf function follows the stack Last-In-First-Out (LIFO) concept, which means that the expressions are evaluated from right to left. Step 8: The first expression to be evaluated is ++a : - ++a increments a to 13 and returns the updated value, which is 13. Step 9: The next expression to be evaluated is a++ : - a++ returns the current value of a (13) and then increments a to 14. - The returned value is 13. Step 10: Finally, the last expression to be evaluated is a , which has the current value of 14. Therefore, the output of the program will be: 22 13 14 14 This output corresponds to the value of b , followed by the evaluated values of a++ , a , and ++a , respectively, in the printf statement.
💡Key Conceptual Anchor:Operators And Expressions
Question 7 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which among the following is never possible as an output for a float?
Correct Answer: Option D — None of the mentioned
Detailed Academic Explanation:
In C, a float can represent both whole numbers and decimal numbers due to its ability to store values in floating-point format. Option A: 3.666666 is a valid float representation with precision. Option B: 3.666 is also a valid float value, just with fewer decimal places. Option C: 3 is an integer, but it can still be represented as a float (e.g., 3.0). Therefore, all the options listed are valid float outputs depending on how the float is stored or printed. Hence, the correct answer is Option D: None of the mentioned .
💡Key Conceptual Anchor:Operators And Expressions
Question 8 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following cannot be used inside sizeof?
Correct Answer: Option B — functions
Detailed Academic Explanation:
sizeof is a compile-time operator in C that determines the size, in bytes, of a variable or data type. Option A: pointers – Valid. sizeof can be used with pointers to determine the size of the pointer type. Option B: functions – Invalid. You cannot use sizeof on functions because functions do not have a defined size at compile time. sizeof requires a complete type, and functions are not complete objects in C. Option C: macro definition – Valid. If the macro expands to a valid expression or type, sizeof can be used on it. Option D: none of the mentioned – Incorrect because functions cannot be used with sizeof . Therefore, the correct answer is Option B: functions.
💡Key Conceptual Anchor:Operators And Expressions
Question 9 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In C programming language, which of the following type of operators have the highest precedence
Correct Answer: Option D — Arithmetic operators
Detailed Academic Explanation:
Arithmetic operators is the correct answer to “In C programming language, which of the following type of operators have the highest precedence”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 10 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following comments about the ++ operator are correct?
Correct Answer: Option E — All of the above
Detailed Academic Explanation:
All of the above is the correct answer to “Which of the following comments about the ++ operator are correct”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 11 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Determine output of the following program code. #include<stdio.h> void main() { int a, b=7; a = b<4 ? b<<1 : ++b>4 ? 7>>1 : a; printf("%d %d", a, b); }
Correct Answer: Option D — 3 8
Detailed Academic Explanation:
3 8 is the correct answer to “Determine output of the following program code. #include<stdio.h> void main() { int a, b=7; a = b<4 ? b<<1 : ++b>4 ? 7>>1 : a; printf("%d %d", a, b); }”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 12 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Consider the following program fragment, and choose the correct one. void main() { int a, b = 2, c; a = 2 * (b++); c = 2 * (++b); }
Correct Answer: Option A — a = 4, c = 8
Detailed Academic Explanation:
a = 4, c = 8 is the correct answer to “Consider the following program fragment, and choose the correct one. void main() { int a, b = 2, c; a = 2 * (b++); c = 2 * (++b); }”. This question is standard in competitive examination syllabi for Operators And Expressions.
sizeof(struct stemp*) = sizeof(union utemp*) = sizeof(char *) is the correct answer to “Which among the following statement is right”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 14 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> int main() { float a = 2.455555555555; printf("%f", a); }
Correct Answer: Option A — 2.455555
Detailed Academic Explanation:
2.455555 is the correct answer to “What will be the output of the following C code? #include <stdio.h> int main() { float a = 2.455555555555; printf("%f", a); }”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 15 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following % operation is invalid?
Correct Answer: Option C — 2 % 4f
Detailed Academic Explanation:
2 % 4f is the correct answer to “Which of the following % operation is invalid”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 16 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In the following C code, the union size is decided by? union temp { char a; int b; float c; };
Correct Answer: Option D — both int and float
Detailed Academic Explanation:
both int and float is the correct answer to “In the following C code, the union size is decided by? union temp { char a; int b; float c; };”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 17 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Modulus for float could be achieved by?
Correct Answer: Option C — fmod(a, b)
Detailed Academic Explanation:
fmod(a, b) is the correct answer to “Modulus for float could be achieved by”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 18 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which among the following has the highest precedence?
Correct Answer: Option C — sizeof()
Detailed Academic Explanation:
sizeof() is the correct answer to “Which among the following has the highest precedence”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 19 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
%f access specifier is used for . . . . . . . .
Correct Answer: Option C — Floating type
Detailed Academic Explanation:
Floating type is the correct answer to “%f access specifier is used for . . . . . . . .”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 20 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> printf("%d", sizeof('a'));
Correct Answer: Option C — 4
Detailed Academic Explanation:
4 is the correct answer to “What will be the output of the following C code? #include <stdio.h> printf("%d", sizeof('a'));”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 21 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Loss in precision occurs for typecasting from. . . . . . . .
Correct Answer: Option D — float to int
Detailed Academic Explanation:
float to int is the correct answer to “Loss in precision occurs for typecasting from. . . . . . . .”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 22 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> union temp { char a; char b; int c; }t; int main() { printf("%d", sizeof(t)); return 0; }
Correct Answer: Option C — 4
Detailed Academic Explanation:
4 is the correct answer to “What will be the output of the following C code? #include <stdio.h> union temp { char a; char b; int c; }t; int main() { printf("%d", sizeof(t)); return 0; }”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 23 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Select the odd one out with respect to type?
Correct Answer: Option D — float
Detailed Academic Explanation:
float is the correct answer to “Select the odd one out with respect to type”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 24 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Predict the data type of the following mathematical operation? 2 * 9 + 3 / 2 . 0
Correct Answer: Option D — double
Detailed Academic Explanation:
double is the correct answer to “Predict the data type of the following mathematical operation? 2 * 9 + 3 / 2 . 0”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 25 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
How many digits are present after the decimal in float value?
Correct Answer: Option C — 6
Detailed Academic Explanation:
6 is the correct answer to “How many digits are present after the decimal in float value”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 26 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the size of float in a 32-bit compiler?
Correct Answer: Option C — 4
Detailed Academic Explanation:
4 is the correct answer to “What is the size of float in a 32-bit compiler”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 27 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Size of an array can be evaluated by . . . . . . . . (Assuming array declaration int a[10];)
Correct Answer: Option A — sizeof(a)
Detailed Academic Explanation:
sizeof(a) is the correct answer to “Size of an array can be evaluated by . . . . . . . . (Assuming array declaration int a[10];)”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 28 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What type of value does sizeof return?
Correct Answer: Option C — unsigned int
Detailed Academic Explanation:
unsigned int is the correct answer to “What type of value does sizeof return”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 29 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which among the following is never possible in C when members are different in a structure and union? //Let P be a structure //Let Q be a union
Correct Answer: Option D — none of the mentioned
Detailed Academic Explanation:
none of the mentioned is the correct answer to “Which among the following is never possible in C when members are different in a structure and union? //Let P be a structure //Let Q be a union”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 30 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the size of the following C structure? #include <stdio.h> struct temp { int a[10]; char p; };
Correct Answer: Option D — 44
Detailed Academic Explanation:
44 is the correct answer to “What will be the size of the following C structure? #include <stdio.h> struct temp { int a[10]; char p; };”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 31 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the sizeof(void) in a 32-bit C?
Correct Answer: Option B — 1
Detailed Academic Explanation:
1 is the correct answer to “What is the sizeof(void) in a 32-bit C”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 32 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which data type is suitable for storing a number like? 10.0000000001
Correct Answer: Option C — double
Detailed Academic Explanation:
double is the correct answer to “Which data type is suitable for storing a number like? 10.0000000001”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 33 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
In a 32-bit compiler, which 2 types have the same size?
Correct Answer: Option C — int and float
Detailed Academic Explanation:
int and float is the correct answer to “In a 32-bit compiler, which 2 types have the same size”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 34 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> printf("%d", sizeof(strlen("HELLOWORLD")));
Correct Answer: Option A — Output, 4
Detailed Academic Explanation:
Output, 4 is the correct answer to “What will be the output of the following C code? #include <stdio.h> printf("%d", sizeof(strlen("HELLOWORLD")));”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 35 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> printf("%.0f", 2.89);
Correct Answer: Option D — 3
Detailed Academic Explanation:
3 is the correct answer to “What will be the output of the following C code? #include <stdio.h> printf("%.0f", 2.89);”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 36 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What is the sizeof(char) in a 32-bit C compiler?
Correct Answer: Option C — 1 Byte
Detailed Academic Explanation:
1 Byte is the correct answer to “What is the sizeof(char) in a 32-bit C compiler”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 37 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> (sizeof double = 8, float = 4, void = 1) #define PI 3.14 int main() { printf("%d", sizeof(PI)); }
Correct Answer: Option A — Output is 8
Detailed Academic Explanation:
Output is 8 is the correct answer to “What will be the output of the following C code? #include <stdio.h> (sizeof double = 8, float = 4, void = 1) #define PI 3.14 int main() { printf("%d", sizeof(PI)); }”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 38 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
What will be the output of the following C code? #include <stdio.h> main() { int a = 1; printf("size of a is %d, ", sizeof(++a)); printf("value of a is %d", a); };
Correct Answer: Option A — size of a is 4, value of a is 1
Detailed Academic Explanation:
size of a is 4, value of a is 1 is the correct answer to “What will be the output of the following C code? #include <stdio.h> main() { int a = 1; printf("size of a is %d, ", sizeof(++a)); printf("value of a is %d", a); };”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 39 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
Which of the following is not an operator in C?
Correct Answer: Option D — None of the mentioned
Detailed Academic Explanation:
None of the mentioned is the correct answer to “Which of the following is not an operator in C”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
Question 40 of 40
★ FPSC
★ PPSC
★ FPSC
★ PPSC
%lf is used to display?
Correct Answer: Option C — double
Detailed Academic Explanation:
double is the correct answer to “%lf is used to display”. This question is standard in competitive examination syllabi for Operators And Expressions.
💡Key Conceptual Anchor:Operators And Expressions
✓Link copied to clipboard
Continue Your Practice
Advance Html — Part 1
Master the next curriculum module with 40 exam-standard MCQs.
💡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.