What will be the output of following C++ code?
Posted: Wed Jul 13, 2022 7:51 pm
#include <iostream>
#include <string>
using namespace std;
namespace My_old_school_and_college_friends_number
{
long int f1 = 9999999999;
long int f2 = 1111111111;
}
namespace contacts = My_old_school_and_college_friends_number;
int main(){
cout<<contacts::f1;
}
a) 9999999999
b) 1111111111
c) error
d) segmentation fault
#include <string>
using namespace std;
namespace My_old_school_and_college_friends_number
{
long int f1 = 9999999999;
long int f2 = 1111111111;
}
namespace contacts = My_old_school_and_college_friends_number;
int main(){
cout<<contacts::f1;
}
a) 9999999999
b) 1111111111
c) error
d) segmentation fault