Question 66

Computer Awareness Data Structure Medium

What happens if the following program is executed in C and C++? \[\]int main(void) { \[\]int new = 1; \[\]printf("%d", new);\[\] }

(A) Error in both C and C++
(B) A successful run in both C and C++
(C) Error in C and successful execution in C++
(D) Error in C++ and successful execution in C
✓ Correct Answer: Option D Verified Solution

📘 Step-by-Step Solution & Detailed Explanation:

In C, `new` is not a keyword, so the code runs successfully.
In C++, `new` is a reserved keyword, causing a compilation error.
Answer: D. Error in C++ and successful execution in C.

Practice Similar Data Structure Questions

Reinforce your conceptual grasp with related questions from CUET-MCA 2021:

Q35 Which of the following standard algorithms is not a greedy algorithm?
Solve →
Q54 Which of these operators is used to allocate memory to array variable in...
Solve →
Q56 Consider the following function implemented in C \[\] void test fun(int x,...
Solve →
Q69 What is the output of this C code? \[\]void main() \[\]int x = 18;...
Solve →
Q73 The minimum number of functions should be present in a ( C++ ) program for...
Solve →
Full-Length Test Series

Prepare for CUET-MCA Under Real Exam Conditions

Take timed full-length mock tests with authentic question distributions, negative marking (+12/-3 in Math), and instant All India Rank calculation.

Start Free Mock Test Series →