1. What is C language?
Answer: C is a general-purpose, procedural programming language developed in the early 1970s by
Dennis Ritchie.
2. Who developed the C language?
Answer: Dennis Ritchie at Bell Labs.
3. What are the key features of C?
Answer: Portability, low-level access to memory, simple set of keywords, and clean style.
4. What is a variable in C?
Answer: A variable is a container to store data values.
5. What is the difference between int and float?
Answer: int is used for integers, float is used for floating-point numbers.
6. What is a pointer in C?
Answer: A pointer is a variable that stores the memory address of another variable.
7. What is the use of printf()?
Answer: It is used to display output on the screen.
8. What is the use of scanf()?
Answer: It is used to take input from the user.
9. What is a function in C?
Answer: A function is a block of code that performs a specific task.
10. What is the main() function?
Answer: It is the entry point of any C program.
11. What is recursion?
Answer: When a function calls itself, it is called recursion.
12. What is the difference between = and ==?
Answer: = is an assignment operator, == is a comparison operator.
13. What are loops in C?
Answer: Loops are used to execute a block of code repeatedly.
14. What are the types of loops in C?
Answer: for, while, and do-while loops.
15. What is an array?
Answer: An array is a collection of elements of the same data type.
16. How to declare an array?
Answer: data_type array_name[size];
17. What is a string in C?
Answer: A string is a sequence of characters terminated by a null character '\0'.
18. What is a structure?
Answer: A structure is a user-defined data type that allows to combine data of different types.
19. What is a union?
Answer: A union is like a structure but with shared memory for all members.
20. What is the difference between structure and union?
Answer: In structure, each member has its own memory; in union, all members share the same
memory.
21. What is the use of sizeof()?
Answer: It returns the size of a data type or variable in bytes.
22. What is typecasting?
Answer: Converting one data type into another is called typecasting.
23. What is a header file?
Answer: A file containing C function declarations and macro definitions to be shared between
several source files.
24. What is the use of #include?
Answer: It is used to include header files in a C program.
25. What is the use of #define?
Answer: It is used to define constants or macros.
26. What is the difference between call by value and call by reference?
Answer: In call by value, copies are passed; in call by reference, addresses are passed.
27. What is a dangling pointer?
Answer: A pointer pointing to a memory location that has been deleted or freed.
28. What is memory leak?
Answer: When a program doesn't release the memory it has allocated.
29. What is the difference between malloc() and calloc()?
Answer: malloc() allocates memory without initializing it, calloc() allocates and initializes to zero.
30. What is free()?
Answer: free() is used to deallocate previously allocated memory.