Question 1: C++ Variable Initialization
Which is the correct way to initialize a variable in C++?
Question 2: C++ Ternary Operator
Which of the following is the correct syntax of the ternary operator in C++?
Question 3: C++ Pointers and Arrays
Which of the following statements is true about arrays and pointers in C++?
Question 4: C++ Nested If
What is the output of the following C++ code snippet?
Question 5: C++ Continue Statement in Loops
What is the effect of the continue statement inside a C++ loop?
Question 6: C++ Guess the Output – getline from File
Suppose "note.txt" contains:
C++ is fun!
What will this program print?
Question 7: C++ Guess the Output – Recursion
What will be the output of the following program?
Question 8: C++ Array and Functions
When an array is passed to a function in C++, what is actually passed?
Question 9: C++ this Pointer
What does the this pointer in C++ represent?
Question 10: C++ String to C-Style String
Which function is used to convert a C++ string to a C-style character array?
Question 11: C++ Global vs Local Variable
Which statement is true about global and local variables in C++?
Question 12: C++ Guess the Output – Mixed Operators
What will be the output of the following C++ code snippet?
Question 13: C++ Guess the Output – Pointer Size
What will the output of the following program be (on a 64-bit system)?
Question 14: C++ Ternary Operator as If-Else
Which of the following C++ statements correctly uses the ternary operator to check if a number n is even or odd?
Question 15: C++ Guess the Output – Continue
What will be the output of the following C++ code snippet?
Question 16: C++ Closing File
Why is file.close() used in C++?
Question 17: C++ Function Prototypes
Why are function prototypes used in C++?
Question 18: C++ Guess the Output – Array and Pointers
What will the following code print?
Question 19: C++ Guess the Output – Destructor
What will the program print?
Question 20: C++ Guess the Output – String Replace
What will this code print?