Top 25 C Programming Viva Questions
Top 25 C Programming Viva Questions
1. Basics of C
1. What is C programming?
C is a general-purpose, structured, and procedural programming language developed
by Dennis Ritchie in the 1970s. It is widely used for system programming and
developing operating systems.
Variable: A memory location whose value can change during program execution.
Constant: A memory location whose value remains fixed throughout the program.
Arithmetic: +, -, *, /, %
Relational: ==, !=, <, >, <=, >=
Logical: &&, ||, !
Bitwise: &, |, ^, ~, <<, >>
Assignment: =, +=, -=, etc.
if statement: Used for complex conditions; allows ranges and logical expressions.
switch statement: Used for discrete values; evaluates a single expression against multiple
cases.
1. for loop
2. while loop
3. do-while loop
4. Functions
11. What is the difference between call by value and call by reference?
Call by value: Passes a copy of the value; changes do not affect the original variable.
Call by reference: Passes the address of the variable; changes affect the original variable.
6. Pointers
*: Dereference operator, retrieves the value from the memory address a pointer holds.
&: Address-of operator, retrieves the memory address of a variable.
7. Storage Classes
8. File Handling
9. Memory Management
10. Miscellaneous
Let me know if you need more questions or explanations for any specific topic!