Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    int StaticFunction(int)
    {
    int sum = 0;
    sum = sum + 12;
    return sum;
    }
    int main(void)
    {
    int num = 5, Res;
    Res = StaticFunction(Res);
    cout << Res << endl;
    return 0;
    }
    1. 12
    2. Compilation Error
    3. Runtime Error
    4. 5
    5. None of these
Correct Option: A

Even Though we passed the value, we didn’t caught to manipulate it, So it is printing as 12.



Your comments will be displayed only after manual approval.