#include<iostream.h> class CuriousTabTest { public: CuriousTabTest(int &x, int &y) { x++; y++; } }; int main() { int a = 10, b = 20; CuriousTabTest objBT(a, b); cout<< a << " " << b; return 0; }
#include<iostream.h> int main() { int x = 10, y = 20; int *ptr = &x; int &ref = y; *ptr++; ref++; cout<< x << " " << y; return 0; }
#include<iostream.h> class CuriousTab { int a, b, c; public: void SetValue(int x, int y ,int z) { a = x; b = y; c = z; } void Display() { cout<< a << " " << b << " " << c; } }; int main() { CuriousTab objCuriousTab; int x = 2; int &y = x; y = 5; objCuriousTab.SetValue(x, ++y, x + y); objCuriousTab.Display(); return 0; }
#include<iostream.h> int main() { int x = 80; int y& = x; x++; cout << x << " " << --y; return 0; }
#include<iostream.h> class CuriousTab { int x, y; public: void SetValue(int &xx, int &yy) { x = xx ++; y = yy; Display(); } void Display() { cout<< x << " " << y; } }; int main() { int x = 10; int &y = x; CuriousTab objCuriousTab; objCuriousTab.SetValue(x , y); return 0; }
#include<iostream.h> int main() { int arr[] = {1, 2 ,3, 4, 5}; int &zarr = arr; for(int i = 0; i <= 4; i++) { arr[i] += arr[i]; } for(i = 0; i <= 4; i++) cout<< zarr[i]; return 0; }
#include<iostream.h> int main() { int x = 0; int &y = x; y = 5; while(x <= 5) { cout<< y++ << " "; x++; } cout<< x; return 0; }
#include<iostream.h> int main() { int x = 10; int &y = x; x = 25; y = 50; cout<< x << " " << --y; return 0; }
#include<iostream.h> int main() { int m = 2, n = 6; int &x = m++; int &y = n++; m = x++; x = m++; n = y++; y = n++; cout<< m << " " << n; return 0; }
#include<iostream.h> class Tab { int x, y; public: Tab(int x, int y) { this->x = x; this->y = y; } void Display() { cout<< x << " " << y; } }; int main() { int x = 50; int &y = x ; Tab b(y, x); return 0; }
#include<iostream.h> class CuriousTabBase { public: int x, y; public: CuriousTabBase(int xx = 0, int yy = 0) { x = xx; y = yy; } }; class CuriousTabDerived : public CuriousTabBase { private: CuriousTabBase objBase; public: CuriousTabDerived(int xx, int yy) : CuriousTabBase(xx), objBase(yy) { cout << this->x << " " << this->y << " " << objBase.x << " " << objBase.y << " "; } ~CuriousTabDerived() { } }; int main() { CuriousTabDerived objDev(11, 22); return 0; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.