#include<iostream> #include<algorithm> using namespace std; template<class t> class greatest{ private: int a,b; public: void check(int a,int b){ cout<<"Enter two no.\n"; cin>>a>>b; if(a>b){ cout<<a<<" is greater than "<<b<<endl; } else if(a==b){ cout<<a<<" is equal with "<<b<<endl; } else{ cout<<b<<" is greater than "<<a<<endl; } } }; int main(){ int a,b; greatest<int>g; g.check(a,b); return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter