Skip to main content

Important Introduction to Programming Short Questions

Chapter: 25
Question 1:
What was one of the major operating systems written in C language?
Answer: The Unix operating system was written in C language.
Chapter: 25
Question 2:
What is the significance of structured programming in software development?
Answer: Structured programming is significant as it organizes programs into smaller, manageable functions, making the code more readable and maintainable.
Chapter: 25
Question 3:
What is the "Divide and Conquer" rule in structured programming?
Answer: The "Divide and Conquer" rule suggests that if a function becomes too long, it should be divided into smaller, well-defined tasks, each of which becomes a separate function.
Chapter: 25
Question 4:
What is the "Single Entry Single Exit" rule in structured programming?
Answer: The "Single Entry Single Exit" rule states that functions should ideally have only one entry and one exit point to enhance readability and maintainability of the code.
Chapter: 25
Question 5:
Why is it important to comment on your programs in structured programming?
Answer: Comments are crucial as they help both others and the original developer understand the code, especially when revisiting it after a long time.
Chapter: 25
Question 6:
What is the limitation of structured programming that led to the development of Object-Oriented Programming (OOP)?
Answer: Structured programming focuses on functions rather than the data they process, which became problematic as programs grew more complex, leading to the development of OOP.
Chapter: 25
Question 7:
Who is credited with enhancing the C language into what became known as C++?
Answer: Bejarne Stroustrup at Bell Labs is credited with enhancing the C language into C++, initially known as "C with Classes."
Chapter: 25
Question 8:
What are default function arguments in C++?
Answer: Default function arguments in C++ allow you to specify default values for parameters in a function, which are used if no arguments are provided for those parameters when the function is called.
Chapter: 25
Question 9:
Why are default values for parameters in a function written from right to left in C++?
Answer: Default values are written from right to left because, during function calls, arguments are assigned to parameters from left to right, and you cannot skip a parameter on the left to assign a value to a parameter on the right.
Chapter: 25
Question 10:
What is an inline function in C++?
Answer: An inline function in C++ is a function that is expanded in line when it is called, meaning the compiler replaces the function call with the function code itself, eliminating the overhead of a function call.