Nguyễn Trà
New member
What happens if the following program is executed in C and C++?
A. Error in both C and C++
B. Outputs Hello twice in both C and C++
C. Error in C and Outputs Hello twice in C++
D. Error in C++ and Outputs Hello twice in C
Code:
#include <stdio.h>
void func()
{
printf("Hello");
}
void main()
{
func();
func(2);
}
B. Outputs Hello twice in both C and C++
C. Error in C and Outputs Hello twice in C++
D. Error in C++ and Outputs Hello twice in C