VIVA QUESTIONS
VIVA QUESTIONS
What is recursion?
A function that calls itself.
What is an array in C?
A collection of elements of the same data type stored in contiguous memory.
What is a structure in C?
A user-defined data type that groups variables of different types.
Can structures contain arrays?
Yes, structures can contain arrays as members.
What is a union in C?
A user-defined data type where all members share the same memory location.
What is a file in C?
A storage area in memory or disk used for storing data permanently.
Local variables are declared inside a block or function but global variables are
declared outside the block or function to be accessed globally.
What are pointers?
Pointers are used to store the address of the variable or a memory location
Conditional Statements
Loops
Pointers
1. What is a pointer?
A variable that stores the address of another variable.
2. What is the difference between * and & in pointers?
* dereferences a pointer, and & gets the address of a variable.
3. What is a null pointer?
A pointer that does not point to any memory location.
Input/Output
1. What is the purpose of scanf()?
It reads input from the user.
2. What is printf() used for?
It displays output to the console.
3. Can we use scanf() for strings?
Yes, using %s format specifier.