Home / C++ Programming / Functions - C++ :: Discussion

Discussion :: Functions - C++

  1. What will be the output of the following program?

        #include
        int main()
        {   
           float Amount;    
           float Calculate(float P = 5.0, int N = 2, float R = 2.0);   
           Amount = Calculate();    
           coutreturn 0;
       }
    
        float Calculate(float P, int N, float R)
        {    
           int Year = 1;  
           float Sum = 1 ;   
           Sum = Sum * (1 + P * ++N * R);    
           Year =  (int)(Year + Sum);   
           return Year;  
       }
    

  2. A.

    21

    B.

    22

    C.

    31

    D.

    32

    E.

    None of these

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    No answer description available for this question.


Be The First To Comment