Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    int Fun(int p, int q)
    {
    int res;
    res = 0;
    while (q != 0)
    {
    res = res + p;
    q = q - 2;
    }
    return(res);
    }
    int main ()
    {
    int p = 12, q = 10;
    cout << Fun(p, q) ;
    return(0);
    }
    1. 60
    2. 12
    3. 10
    4. Compilation Error
    5. None of these
Correct Option: A

We are multiplying these values by adding every values.



Your comments will be displayed only after manual approval.