Answers to C Programming Questions
1. What do you mean by a program? What is a programming language?
- Program: A set of instructions written in a specific language that tells a computer w
- Programming Language: A formal language used to write programs that can be exec
2. Who developed 'C' programming language and where?
- Dennis Ritchie developed the C programming language at Bell Laboratories (AT&T B
3. Which operating system was written in C?
- The UNIX operating system was written in C.
4. Why is 'C' called a middle-level language?
- C combines features of both high-level and low-level languages. It allows direct inte
5. Mention any structured programming languages.
- C, Pascal, Ada, FORTRAN.
6. Mention any high-level languages.
- Python, Java, Ruby, JavaScript.
7. C is a portable language. Justify your answer.
- C is portable because its code can be written on one system and compiled on anoth
8. How can comments in C be written?
- Single-line comments: Use // (e.g., // This is a comment).
- Multi-line comments: Use /* ... */ (e.g., /* This is a multi-line comment */).
9. What are preprocessor directives?
- Preprocessor directives are instructions processed by the C preprocessor before co
10. What is the purpose of #include?
- The #include directive is used to include header files into a program. For example, #
11. What is the use of <stdio.h> header file?
- <stdio.h> provides functions for input and output operations, like printf() and scanf(
12. What is #define?
- The #define directive is used to define constants or macros. Example: #define PI 3.1
13. What do you mean by a global variable?
- A global variable is a variable declared outside all functions. It can be accessed by a
14. What do you mean by a local variable?
- A local variable is declared inside a function and can only be accessed within that fu
15. What is main() function?
- The main() function is the entry point of a C program where execution begins.
16. What is object program/object code?
- Object code is the machine code generated by the compiler after translating the sou
17. What do you mean by Linking?
- Linking is the process of combining object files and libraries to create an executable
18. Write any two merits of C-programming language.
- Portability.
- Efficiency in system-level programming.
19. What is a high-level language? Give one example.
- High-level languages are programmer-friendly languages that are closer to human la
20. What is a low-level language? Give one example.
- Low-level languages are hardware-friendly and closer to machine language, like Ass
21. Write the history and evolution of C Language.
- C was developed in 1972 by Dennis Ritchie at Bell Labs for developing the UNIX OS.
22. Why is 'C' called a structured language?
- C uses a systematic approach for solving problems, dividing code into functions an
23. Is 'C' a portable language? Explain.
- Yes, C is portable because the same C code can be compiled and executed on differ
24. Explain the structure of a C program.
- A C program typically includes:
1. Documentation section.
2. Preprocessor directives.
3. Global declarations.
4. main() function.
5. Other functions.
25. What is Documentation Section?
- It includes comments at the beginning of the program to describe its purpose and fu
26. What do you mean by preprocessor directive?
- Preprocessor directives provide instructions to the compiler to preprocess the sour
27. Explain the features of C Language.
- Portability.
- Rich library support.
- Efficient performance.
- Middle-level features.
28. 'C' is called a middle-level language. Support this statement.
- C bridges the gap between high-level and low-level languages by supporting both h
29. Explain the steps or stages of creating and executing a C-program.
- Writing the program (source code).
- Compilation.
- Linking.
- Execution.
30. What is Compilation?
- Compilation is the process of converting source code into machine code.
31. What are header files? What is its significance?
- Header files contain function prototypes and macro definitions. Example: <stdio.h>
32. Write the applications of C Language.
- System programming.
- Embedded systems.
- Game development.
33. What is ANSI C?
- ANSI C refers to the standardized version of C established by the American Nationa
34. What is Modular Programming?
- Modular programming is a technique that divides a program into smaller, manageab