Operators in C — Practice Set + MCQs + Viva Questions
Great! Here is a full study package for Operators in C π✨
(You can request PDF also — I will generate for you.)
π― Operators in C — Practice Set + MCQs + Viva Questions
π Part A — Important Practice Questions
Short Questions
-
What is an operator? Give examples.
-
What is the difference between
==and=? -
Explain pre-increment and post-increment with example.
-
What is modulus operator? Give an example.
-
What is ternary operator? Write its syntax.
Coding Questions
-
Write a C program to demonstrate all arithmetic operators.
-
Write a program to compare two numbers using relational operators.
-
Write a program using logical operators to find the largest of 3 numbers.
-
Write a program that shows the working of
++and--. -
Write a program to find even or odd using the ternary operator.
❓ Part B — MCQs (Multiple Choice Questions)
1️⃣ Which operator has the highest precedence?
A) &&
B) +
C) ()
D) =
✔ Answer: C
2️⃣ The operator % is used for:
A) Division
B) Remainder
C) Multiplication
D) None
✔ Answer: B
3️⃣ Which of the following is a logical operator?
A) &
B) &&
C) <<
D) ++
✔ Answer: B
4️⃣ Bitwise NOT operator is:
A) !
B) ~
C) ^
D) |
✔ Answer: B
5️⃣ Conditional operator is:
A) ? :
B) &&
C) <
D) sizeof
✔ Answer: A
6️⃣ a = a + 5 can also be written as:
A) a += 5
B) a -= 5
C) a == 5
D) a != 5
✔ Answer: A
7️⃣ The operator used to fetch address of a variable:
A) *
B) &
C) sizeof
D) ->
✔ Answer: B
8️⃣ Which is the bitwise XOR operator?
A) |
B) &
C) ^
D) <<
✔ Answer: C
π Part C — Viva Questions with Answers
| Question | Answer |
|---|---|
| What are operators? | Symbols that perform operations on operands. |
| What is precedence? | Priority of operators in expression evaluation. |
| What is associativity? | Direction of evaluation when precedence is same. |
Difference between = and ==? |
= assigns value, == compares values. |
What does sizeof do? |
Gives memory size of variable or datatype. |
| What are unary operators? | Act on one operand: ++, --, sizeof, ! |
| Example of bitwise operator? | &, ` |
| What is ternary operator used for? | Short form of if-else decision making. |
π Shall I prepare a PDF?
Options available:
A) Notes + Practice Questions
B) Notes + MCQs + Viva
C) Complete Package (Notes + MCQs + Viva + Code Examples) ⭐
Reply with the option (A/B/C)
and write your Name & College (optional) for front page.
Example format:
Option C
Name: Ayush Raj
College: L.N. Mishra College of Business Management
Semester: 2nd Sem BCA
Subject: C Programming
Just send this info — I will create a beautiful PDF and give you download link π✨
Comments
Post a Comment