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

1 thought on “What will be the output of the following C++ code?”

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

Leave a Comment