OOCP2_1

//BCA Support //www.bcasupport.xyz #include <iostream.h> #include <conio.h> class c1 { int no; public: c1() { no=10; } friend void max(); }; class c2 { int no; public: c2() { no=20; } friend void max(); }; void max(); int main() { clrscr(); max(); getch(); return 0; } void max() { c1 obj1; c2 obj2; cout<<"\nNumber 1 : "<<obj1.no; cout<<"\nNumber 2 : "<<obj2.no; if(obj1.no>obj2.no) cout<<endl<<obj1.no<<" is larger."; else cout<<endl<<obj2.no<<" is larger."; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.