1. What is C language?
C is a procedural programming language used to develop system and application software.
2. Who developed C language?
C was developed by Dennis Ritchie.
3. Why is C called a middle-level language?
Because it supports both low-level and high-level programming features.
4. What is a compiler?
A compiler converts C source code into machine code.
5. What is a variable?
A variable is a named memory location used to store data.
6. What is a data type?
A data type defines the type and size of data stored in a variable.
7. Name basic data types in C.
int, float, char, double.
8. What is a keyword?
A keyword is a reserved word with predefined meaning in C.
9. What is a constant?
A constant is a value that cannot be changed during program execution.
10. What is an identifier?
An identifier is the name of a variable, function, or array.
11. What is an array?
An array stores multiple values of the same data type in continuous memory.
12. What is a pointer?
A pointer stores the address of another variable.
13. What is NULL pointer?
A pointer that points to nothing or zero address.
14. What is dangling pointer?
A pointer that points to a memory location that has been freed.
15. What is function?
A function is a block of code that performs a specific task.
16. What is function prototype?
It tells the compiler about function name, return type, and parameters.
17. What is recursion?
Recursion is a function calling itself.
18. What is infinite loop?
A loop that never terminates on its own.
19. Types of loops in C?
for loop, while loop, do-while loop.
20. Difference between while and do-while loop?
while checks condition first, do-while executes at least once.
21. What is break statement?
It terminates loop or switch immediately.
22. What is continue statement?
It skips the current iteration and moves to the next one.
23. What is structure?
Structure groups different data types under one name.
24. What is union?
Union stores different data types in the same memory location.
25. Difference between structure and union?
Structure uses separate memory, union shares memory.
26. What is typedef?
typedef creates a new name for an existing data type.
27. What is enum?
enum defines a set of named integer constants.
28. What is storage class?
It defines scope, lifetime, and visibility of variables.
29. Types of storage classes in C?
auto, static, extern, register.
30. What is static variable?
A variable that retains its value between function calls.
31. What is extern keyword?
Used to declare a global variable defined in another file.
32. What is file handling?
File handling is used to store and read data from files.
33. What is fopen()?
It is used to open a file in C.
34. Difference between text file and binary file?
Text file stores data in readable form, binary does not.
35. What is malloc()?
malloc allocates memory dynamically at runtime.
36. What is calloc()?
calloc allocates memory and initializes it to zero.
37. Difference between malloc and calloc?
malloc does not initialize memory, calloc initializes to zero.
38. What is free()?
free releases dynamically allocated memory.
39. What is segmentation fault?
An error caused by accessing invalid memory.
40. What is header file?
A header file contains function declarations and macros.
41. Why stdio.h is used?
For input and output functions like printf and scanf.
42. What is macro?
A macro is a preprocessor directive that replaces code textually.
43. What is preprocessor?
It processes code before compilation.
44. What is #include?
Used to include header files.
45. What is #define?
Used to define macros.
46. Difference between = and == ?
= assigns value, == compares values.
47. What is command line argument?
Arguments passed to main() during program execution.
48. What is main() function?
Program execution starts from main().
49. Can a C program run without main()?
No, main() is mandatory.
50. Why C is popular?
Because it is fast, efficient, and close to hardware.
Comments
Post a Comment