Untitled

mail@pastecode.io avatarunknown
plain_text
18 days ago
539 B
1
Indexable
Never
#include <iostream>
using namesapce std;
class sample{
    public :
    static int x;
    static int y;
    int greater (int a, int b)
    {
        x=a;
        y=b;
        if(x>y){
            return a;
        }
        return y;
    }
};
int sample :: a;
int sample :: y;
int main ()
{
    sample s1 , s2 , s3;
     cout<"greater is"<<s1.greater(1,2)<<endl;
     cout<"greater is"<<sampke::greater(1,2)<<endl;
     
     
     cout<"greater is"<<s2.greater(5,2)<<endl;
     cout<"greater is"<<sampke::greater(5,2)<<endl;
     
     
}