Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- class square
- {
- int x;
- public:
- void set_value(int b)
- {x=b; }
- friend void find_square(square);
- };
- void find_square(square a)
- {
- cout<<a.x*a.x<<endl ;
- }
- void main()
- {
- square s;
- clrscr();
- s.set_value(5);
- find_square(s);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement