What happens if the following program is executed in C and C++?
#include <stdio.h> int main(void) { int new = 5; printf("%d", new); }
a) Error in C and successful execution in C++b) Error in both C and C++c) Error in C++ and successful execution in Cd) A successful run in both C and C++
Answer: cExplanation: new is a keyword in C++, therefore, we cannot declare a variable with name new but as there is no such keyword new in C, therefore, the program is compiled and executed successfully in C.