programming in C (QB)
programming in C (QB)
1. Which language characteristic refers to the ability to handle unexpected situations during execution?
A) Readability
B) Reliability
C) Portability
D) Maintainability
Answer: B
Answer: D
A) Procedural
B) Functional
C) Logical
D) Object-oriented
Answer: C
Answer: C
5. Which implementation method converts source code into machine code all at once before execution?
A) Compilation
B) Interpretation
C) Hybrid approach
D) Direct execution
Answer: A
Answer: D
A) Dennis Ritchie
B) Alan Turing
C) John McCarthy
D) Tim Berners-Lee
Answer: A
D) It is platform-independent.
Answer: C
C) Defining variables
Answer: A
A) Functions
B) Header files
C) Main function
D) Comments
Answer: C
- Answer: B
12.Which data type is used to store decimal numbers in C?
A) int
B) char
C) float
D) double
Answer: C
13. Which operator is used for accessing the value stored at a memory address in C?
- A) *
- B) &
- C) %
- D) ^
- Answer: A
A) 16
B) 11
C) 10
D) 7
Answer: B
15. Which function is used to read a string input from the user in C?
- A) printf()
- B) scanf()
- C) gets()
-
D) puts()
- Answer: C
16. How can you print an integer variable num using printf() in C?
A) printf("%d", num);
B) printf("%s", num);
C) printf("%f", num);
D) printf("%c", num);
Answer: A
17. What statement is used to execute a block of code repeatedly as long as a condition is true in C?
- A) for
- B) switch
- C) while
- D) if
- Answer: C
Answer: A
- Answer: A
A) Union
B) Typedef
C) Struct
D) Class
Answer: A
5-Mark Questions:
1. What are the primary factors considered in evaluating programming languages for their effectiveness?
2. How do different language design paradigms influence the development of programming languages?
3. Compare and contrast procedural, functional, and object-oriented programming languages in terms of their
core principles.
4. Explain the difference between compilation and interpretation as methods for implementing programming
languages.
5. Why is the C programming language significant in the history and evolution of programming languages?
6. Discuss the importance of understanding the basic structure of C programs for beginners in programming.
7. How are constants, variables, and data types defined and utilized in C programming?
8. What role do operators play in expressions and logical operations within C programming?
9. How does C manage input and output operations effectively in different computing environments?
10. Describe the fundamental concepts of decision making and branching in C programming.
10-Mark Questions
1. Evaluate the criteria used to assess programming languages for their suitability in various application
domains. Provide examples to illustrate their impact on language design and adoption.
2. Analyze the evolution of programming language categories (procedural, functional, object-oriented) and
their significance in shaping modern programming paradigms.
4. Explore the historical context and milestones that contributed to the development and widespread adoption
of the C programming language. Discuss its enduring legacy in software development.
5. Assess the structural components of a C program and their role in organizing code for readability,
maintenance and scalability.
6. Explain the hierarchy of data types in C programming and their implications for memory allocation and
program efficiency.
7. Discuss the intricacies of operators and expressions in C programming, including their precedence rules and
practical applications in solving computational problems.
8. Evaluate the strategies and techniques used in C programming for managing input from users and output to
various devices or files.
9. Illustrate the concept of decision making and branching using control structures such as if-else statements
and switch-case statements in C programming. Provide scenarios where each is most suitable.
10. Investigate the role of user-defined functions, structures, and pointers in enhancing the modularity,
flexibility, and performance of C programs. Provide examples to demonstrate their practical use cases.