What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
namespace
{
int var = 10;
}
int main()
{
cout<<var;
}
#include <iostream>
#include <string>
using namespace std;
namespace
{
int var = 10;
}
int main()
{
cout<<var;
}A. 10
B. Error
C. Some garbage value
D. Nothing but program runs perfectly
Answer: Option A

Join The Discussion