#include<iostream> using namespace std; class greatest { private: int x,y,z; public: void input() { cout<<"Enter 3 nos."; cin>>x>>y>>z; } void calc() { int r; r=((x>y)&&(x>z)?x:(y>x)&&(y>z)?y:z); cout<<"Greatest no:"<<r; } }; int main() { greatest g; g.input(); g.calc(); }
OUTPUT ::
Enter 3 nos.5 9 2 Greatest no: 9
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
OUTPUT ::
need an explanation for this answer? contact us directly to get an explanation for this answer