0% found this document useful (0 votes)
11 views

programming in C (QB)

Uploaded by

Mahesh Chellam
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

programming in C (QB)

Uploaded by

Mahesh Chellam
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

QUESTION BANK

Language Evaluation Criteria:

1. Which language characteristic refers to the ability to handle unexpected situations during execution?

A) Readability

B) Reliability

C) Portability

D) Maintainability

Answer: B

2. What does "usability" refer to in the context of programming languages?

A) Ability to handle large data sets

B) Ease of writing code

C) Ability to run on multiple platforms

D) User-friendliness for developers

Answer: D

Language Design and Categories:

3. Which language category focuses on describing relationships between data elements?

A) Procedural

B) Functional

C) Logical

D) Object-oriented

Answer: C

4. What is a key characteristic of object-oriented programming languages?

A) Emphasis on mathematical computations

B) Use of functions to define operations

C) Encapsulation and inheritance


D) Execution of rules and logic

Answer: C

Implementation Methods and Programming Environments:

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

6. What is an advantage of using a cross-platform Integrated Development Environment (IDE)?

A) Faster execution of programs

B) Enhanced security features

C) Support for multiple programming languages

D) Improved code debugging capabilities

Answer: D

Overview of C: History and Importance:

7. Who developed the C programming language?

A) Dennis Ritchie

B) Alan Turing

C) John McCarthy

D) Tim Berners-Lee

Answer: A

8. Why is C considered a powerful language for system programming?

A) It supports complex mathematical computations.


B) It provides high-level abstraction.

C) It allows direct manipulation of system hardware.

D) It is platform-independent.

Answer: C

Basic Structure of C Programs and Execution:

9. What is the first step in executing a C program?

A) Compiling the program

B) Writing the main() function

C) Defining variables

D) Creating a header file

Answer: A

10. Which component of a C program must be present for execution to begin?

A) Functions

B) Header files

C) Main function

D) Comments

Answer: C

Constants, Variables, and Data Types:

11. What is the purpose of declaring variables in C programs?

- A) To assign values to constants

- B) To store and manipulate data

- C) To define mathematical operations

- D) To execute control statements

- Answer: B
12.Which data type is used to store decimal numbers in C?

A) int

B) char

C) float

D) double

Answer: C

Operators and Expressions:

13. Which operator is used for accessing the value stored at a memory address in C?

- A) *

- B) &

- C) %

- D) ^

- Answer: A

14. What is the result of the expression 5 + 3 * 2 in C?

A) 16

B) 11

C) 10

D) 7

Answer: B

Managing Input and Output Operations:

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

Decision Making and Branching:

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

18. How is an if-else if-else statement structured in C?

A) if (condition) { code } else if (condition) { code } else { code };

B) if (condition) { code } else { code } else { code };

C) if (condition) { code } { code } else { code };

D) if (condition) { code } else if (condition) { code };

Answer: A

User Defined Functions, Structures, and Unions:

19. What is the primary advantage of using functions in C programs?

- A) Simplifying code organization and reuse


- B) Ensuring type safety

- C) Enabling dynamic memory allocation

- D) Reducing compilation time

- Answer: A

20. Which keyword is used to define a union in C?

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.

3. Compare the advantages and disadvantages of different implementation methods (compilation,


interpretation) in terms of performance, portability, and development workflow.

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.

You might also like