#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() { float Amount; float Calculate(float P = 5.0, int N = 2, float R = 2.0); Amount = Calculate(); cout<< Amount << endl; return 0; } float Calculate(float P, int N, float R) { int Year = 1; float Sum = 1 ; Sum = Sum * (1 + P * ++N * R); Year = (int)(Year + Sum); return Year; }
#include<iostream.h> class CuriousTab { int x; public: CuriousTab(int xx, float yy) { cout<< char(yy); } }; int main() { CuriousTab *p = new CuriousTab(35, 99.50f); return 0; }
#include<iostream.h> class CuriousTabTeam { int x, y; public: CuriousTabTeam(int xx) { x = ++xx; } void Display() { cout<< --x << " "; } }; int main() { CuriousTabTeam objBT(45); objBT.Display(); int *p = (int*)&objBT; *p = 23; objBT.Display(); return 0; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.