What is the effect of the continue statement inside a for loop? 

  • It pauses the loop for a second 
  • It terminates the loop 
  • It jumps to the next iteration 
  • It reruns the current iteration
Inside a for loop, the continue statement causes the loop to skip the rest of its body and jump immediately to the next iteration. This is particularly useful when certain conditions within the loop need to be avoided for specific iterations.

How does an inline function improve the efficiency of a C++ program? 

  • By reducing memory usage 
  • By reducing runtime overhead 
  • By decreasing code size 
  • By performing lazy evaluation
Inline functions are a suggestion to the compiler to insert the complete body of the function wherever that function is used in the code. This can improve efficiency by eliminating the overhead of a function call, potentially leading to faster runtime performance.

The expression a×b can be represented as a _______ b in C++. 

  • * 
  • % 
  • + 
  • -
In C++, the asterisk () is used as the multiplication operator. So, "a×b" is represented as "ab" in C++ programming.

Which method will you use to write a single character to the file stream in C++? 

  • put() 
  • write() 
  • insert() 
  • push()
The put() method is used to write a single character to a file stream in C++. The write() method is typically used to write blocks of binary data, while insert() and push() aren't standard methods for this purpose in C++ streams.

The _______ keyword is used when we want to explicitly pass by reference but prevent the function from modifying the argument. 

  • const 
  • static 
  • virtual 
  • inline
The const keyword is used in C++ to indicate that a value shouldn't be modified. When passing an argument by reference, using const before the parameter type ensures that the function does not alter the original data, providing a level of safety.

What is the potential risk of passing parameters by reference? 

  • Performance overhead 
  • Inability to return values 
  • Accidental data modification 
  • Pointers become null
Passing parameters by reference gives a function direct access to the original data. This can be risky as inadvertent changes in the function can lead to unintended modifications to the data. Care must be taken to ensure the integrity of the data and to avoid unexpected side effects. This risk doesn't exist when passing parameters by value since the function works with a copy of the data.

The use of _______ in nested if-else structures can sometimes enhance readability and maintainability of the code. 

  • curly braces 
  • semicolons 
  • return statements 
  • comments
Using curly braces { } in nested if-else structures ensures clear block demarcation, helping readers understand the scope and flow of the code. Without them, it's easy to misinterpret where conditions start and end, especially in deep nesting.

The _______ header file in C++ provides a set of functions to manipulate C strings and arrays. 

  •  
  •  
  •  
The header file provides a set of functions for manipulating C-style strings and arrays. This includes functions like strcpy, strlen, and others.

What is the purpose of the modulus operator (%) in C++? 

  • Multiplication 
  • Addition 
  • Division 
  • Remainder Calculation
The modulus operator (%) in C++ is used to calculate the remainder of a division operation between two integers. It is especially useful when we need to determine if a number is divisible by another.

In C++20, using enum with _______ allows specifying the underlying type and scope. 

  • type specificity 
  • class 
  • explicit type 
  • annotations
In C++20, when using enum with "class", it allows the developer to specify both the underlying type and the scope. This gives better control and clarity over enumeration definitions.