What happens if the following program is executed in C and C++?
#include <stdio.h>
void func()
{
printf("Hello");
}
void main()
{
func();
func(2);
}
#include <stdio.h>
void func()
{
printf("Hello");
}
void main()
{
func();
func(2);
}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
Answer: Option D
Related Questions on Introduction to C plus plus
What does the 'cin' object in C++ represent?
A. File output stream
B. File input stream
C. Standard output stream
D. Standard input stream

Join The Discussion