Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following C++ code?
#include <iostream>
int const s=9;
int main()
{
std::cout << s;
return 0;
}

What will be the output of the following C++ code?
#include <iostream>
int const s=9;
int main()
{
std::cout << s;
return 0;
}
a) 9
b) Garbage value
c) Error
d) Segmentation fault

Answer: a
Explanation: The program is syntactically and semantically correct hence the program is compiled and executed successfully.

Join The Discussion