#include<iostream.h> #include<string.h> class CuriousTab { char str[50]; char tmp[50]; public: CuriousTab(char *s) { strcpy(str, s); } int CuriousTabFunction() { int i = 0, j = 0; while(*(str + i)) { if(*(str + i++) == ' ') *(tmp + j++) = *(str + i); } *(tmp + j) = 0; return strlen(tmp); } }; int main() { char txt[] = "Welcome to CuriousTab.com!"; CuriousTab objCuriousTab(txt); cout<< objCuriousTab.CuriousTabFunction(); 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; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.