| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent de585b9 commit ef16779
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,32 @@ | |||
| 1 | + #include<iostream.h> | ||
| 2 | + #include<conio.h> | ||
| 3 | + class abc | ||
| 4 | + { | ||
| 5 | + int a; | ||
| 6 | + public: abc() | ||
| 7 | + { | ||
| 8 | + a=0; | ||
| 9 | + } | ||
| 10 | + void getdata(int x) | ||
| 11 | + { | ||
| 12 | + a=x; | ||
| 13 | + } | ||
| 14 | + friend void printvalue(abc); | ||
| 15 | + }; | ||
| 16 | + void printvalue(abc z) | ||
| 17 | + { | ||
| 18 | + cout<<"\nThe value is : "<<z.a; | ||
| 19 | + } | ||
| 20 | + void main() | ||
| 21 | + { | ||
| 22 | + int p; | ||
| 23 | + clrscr(); | ||
| 24 | + cout<<"\nEnter the value : "; | ||
| 25 | + cin>>p; | ||
| 26 | + abc A; | ||
| 27 | + A.getdata(p); | ||
| 28 | + printvalue(A); | ||
| 29 | + getch(); | ||
| 30 | + | ||
| 31 | + clrscr(); | ||
| 32 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments