Advertisement
PROFESSOR_AIH

CSE-1222_C221012_LAB

Aug 16th, 2022
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. /*Asik Ifthaker Hamim*/
  4. typedef long long ll;
  5. typedef unsigned long long int ulli;
  6. typedef long long int lli;
  7. typedef unsigned long long ull;
  8. typedef vector<int> vi;
  9. typedef vector<ll> vl;
  10. typedef vector<string> vs;
  11. #define pb push_back
  12. #define sz(n) n.size()
  13. #define vs(n) (int)n.size()
  14. #define pp pop_back
  15. #define sp(n) setprecision(n)
  16. class largest
  17. {
  18. private:
  19.     int a, b, c;
  20. public:
  21.  
  22.     void input()
  23.     {
  24.         cout << "Enter Three Numbers : ";
  25.         cin >> a>>b>>c;
  26.     }
  27.  
  28.     friend void fd(largest x);
  29. };
  30.  
  31. void fd(largest x)
  32. {
  33.     if (x.a > x.b && x.a > x.c)
  34.     {
  35.         cout << "Largest Number Is: " << x.a<<endl;
  36.     }
  37.     else if (x.b > x.c)
  38.     {
  39.         cout << "Largest Number Is: " << x.b<<endl;
  40.     }
  41.     else
  42.     {
  43.         cout << "Largest Number Is: " << x.c<<endl;
  44.     }
  45. }
  46. int main()
  47. {
  48.     ios_base::sync_with_stdio(false);
  49.     largest x;
  50.     x.input();
  51.  
  52.     fd(x);
  53.     return 0;
  54. }
  55.  
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement