Monday, July 4, 2022

DEFAULT ARGUMENTS USING FUNCATION OVERLOADING #THEHACKERS@

 #include<iostream>

using namespace std;


int max(int a=0, int b=0, int c=0)

{

    return a>b &&a>c ? a:(b>c?b:c);

}

int main()

{

    cout<<max()<<endl;

    cout<<max(10)<<endl;

    cout<<max(10,20)<<endl;

    cout<<max(10,20,30)<<endl;

}

No comments:

Post a Comment

CONSTRUCTURE IN PARENT CLASS

class Parent {     public Parent()     {         System.out.println("Parent Constrcutor");     }              } class Child extend...