Untitled
unknown
plain_text
2 years ago
539 B
8
Indexable
#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;
}Editor is loading...