#include<iostream.h> static int Result; class India { public: void Change(int x = 10, int y = 20, int z = 30) { cout<< x + y + z; } void Display(int x = 40, float y = 50.00) { Result = x % x; cout<< Result; } }; class CuriousTab { int x, y; public: void Change(int x, int y = 50) { cout<< x + y; } }; class CuriousTab: public India, public CuriousTab { public: void Display(int x = 10, int xx = 100, int xxx = 1000) { Result = x + xx % x * x; cout<< Result ; } }; int main() { CuriousTab objCuriousTab; objCuriousTab.India::Display(10, 20.00); return 0; }
#include<iostream.h> class CuriousTabSample { public: int a; float b; void CuriousTabFunction(int a, float b, float c = 100.0f) { cout<< a % 20 + c * --b; } }; int main() { CuriousTabSample objCuriousTab; objCuriousTab.CuriousTabFunction(20, 2.000000f, 5.0f); return 0; }
#include<iostream.h> class CuriousTab { public: int x, y; CuriousTab(int xx = 10, int yy = 20) { x = xx; y = yy; } void Exchange(int *, int *); }; int main() { CuriousTab objA(30, 40); CuriousTab objB(50); objA.Exchange(&objA.x, &objB.y); cout<< objA.x << " " << objB.y << endl; return 0; } void CuriousTab::Exchange(int *x, int *y) { int t; t = *x; *x = *y; *y = t ; }
Copyright ©CuriousTab. All rights reserved.