Functions

Q1: What will be the output of the following program?
#include<iostream.h> 
struct MyData
{
    public:
    int Addition(int a, int b = 10)
    {
        return (a *= b + 2);
    }
    float Addition(int a, float b);
};
int main()
{
    MyData data;
    cout<<data.Addition(1)<<' ';
    cout<<data.Addition(3, 4);
    return 0; 
}

A 12 12

B 12 18

C 3 14

D 18 12

E Compilation fails.

ANS:B - 12 18

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.