C++ Programming :: Namespaces - Discussion
Home > C++ Programming > Namespaces > MCQs Questions Discussion
7 / 12
What is the output of the below C++ program?
#include <iostream>
using namespace std;
namespace first
{
int var = 5;
}
namespace second
{
double var = 3.1416;
}
int main ()
{
int a;
a = first::var + second::var;
cout << a;
return 0;
}
#include <iostream>
using namespace std;
namespace first
{
int var = 5;
}
namespace second
{
double var = 3.1416;
}
int main ()
{
int a;
a = first::var + second::var;
cout << a;
return 0;
}
A8.31416
B8
C9
DCompilation Error
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!