✅ 1. Basic C Programming Concepts
-
What are the main features of the C programming language?
-
Explain the structure of a basic C program.
-
What is the difference between a compiler and an interpreter?
-
How do you declare and initialize variables in C?
-
What is the use of the
printf()andscanf()functions? -
What are keywords in C? List a few examples.
-
Explain the difference between
int,float,char, anddoubledata types. -
What are constants? How do you define them?
-
Explain the purpose of comments in C.
-
How does C handle memory management?
🔢 2. Operators and Control Structures
-
What is the difference between
=and==in C? -
Explain the difference between logical (
&&,||,!) and bitwise operators (&,|,^). -
How does the ternary operator (
? :) work in C? -
What is operator precedence and associativity?
-
Explain the difference between
break,continue, andgoto. -
How do
if,else if, andswitchstatements differ? -
What is a loop? Describe
for,while, anddo-whileloops. -
What is an infinite loop? How can you create one?
-
Explain how to use a
switchstatement effectively. -
How does the
sizeof()operator work in C?
🧮 3. Functions in C
-
What is the syntax for declaring and defining a function?
-
Explain the difference between call by value and call by reference.
-
What is a recursive function? Provide an example.
-
How do you use function pointers?
-
What is the difference between
voidand other return types? -
What is the purpose of the
main()function in C? -
Can a function return multiple values? How?
-
What are inline functions? Are they supported in C?
-
What is a function prototype?
-
How do static functions differ from regular functions?
📊 4. Arrays and Strings
-
How do you declare and initialize an array in C?
-
What is the difference between one-dimensional and multi-dimensional arrays?
-
How do you pass an array to a function?
-
Explain the concept of an array of pointers.
-
What are common string manipulation functions in C (e.g.,
strlen(),strcpy())? -
How do you compare two strings in C?
-
What is the difference between character arrays and strings?
-
How can you reverse a string in C?
-
How do you dynamically allocate memory for an array?
-
What are the limitations of arrays in C?
📌 5. Pointers and Memory Management
-
What is a pointer? How do you declare and initialize one?
-
Explain the difference between
*and&in pointers. -
What are null pointers and void pointers?
-
How does pointer arithmetic work in C?
-
What is the purpose of
malloc(),calloc(),realloc(), andfree()? -
How do you create a pointer to a function?
-
What happens if you access memory out of bounds using a pointer?
-
How do you handle dangling pointers?
-
What is the difference between stack and heap memory?
-
How do you return a pointer from a function safely?
📂 6. Advanced Topics
-
What is a structure? How do you declare and use one?
-
How does a union differ from a structure?
-
What are file handling functions in C (e.g.,
fopen(),fclose())? -
What is a preprocessor directive? Give examples.
-
How do you use
#defineandtypedef? -
What are
enumandbit fieldsin C? -
What is the use of
volatileandconstkeywords? -
What are memory leaks, and how do you prevent them?
-
How do you pass command-line arguments to a C program?
-
What are some common segmentation faults and how to debug them?