#include<iostream.h> class CuriousTab { int x, y; public: CuriousTab(int xx = 0, int yy = 0) { x = xx; y = yy; } void Display() { cout<< x << " " << y; } CuriousTab operator +(CuriousTab z) { CuriousTab objTemp; objTemp.x = x + z.x; objTemp.y = y + z.y; return objTemp; } }; int main() { CuriousTab objCuriousTab1(90, 80); CuriousTab objCuriousTab2(10, 20); CuriousTab objSum; CuriousTab &objRef = objSum; objRef = objCuriousTab1 + objCuriousTab2; objRef.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; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.