#include<iostream.h> typedef void(*FunPtr)(int); int Look(int = 10, int = 20); void Note(int); int main() { FunPtr ptr = Note; (*ptr)(30); return 0; } int Look(int x, int y) { return(x + y % 20); } void Note(int x) { cout<< Look(x) << endl; }
#include<iostream.h> void Tester(float xx, float yy = 5.0); class CuriousTab { float x; float y; public: void Tester(float xx, float yy = 5.0) { x = xx; y = yy; cout<< ++x % --y; } }; int main() { CuriousTab objCuriousTab; objCuriousTab.Tester(5.0, 5.0); return 0; }
#include<iostream.h> long FactFinder(long = 5); int main() { for(int i = 0; i<= 0; i++) cout<< FactFinder() << endl; return 0; } long FactFinder(long x) { if(x < 2) return 1; long fact = 1; for(long i = 1; i <= x-1; i++) fact = fact * i; return fact; }
#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> class CuriousTab { int *p; public: CuriousTab(int xx, char ch) { p = new int(); *p = xx + int(ch); cout<< *p; } ~CuriousTab() { delete p; } }; int main() { CuriousTab objCuriousTab(10, 'B'); return 0; }
#include<iostream.h> struct MyData { public: int Addition(int a, int b = 10) { return (a *= b + 2); } float Addition(int a, float b); }; int main() { MyData data; cout<<data.Addition(1)<<" "; cout<<data.Addition(3, 4); return 0; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.