ARITHMETIC CALCULATIONS USING FUNCTIONS #include
#include sint menu(); int add(int, int); int sub(int, int); int mul(int, int); float div(int, int); void main() { int a,b; cout<<"\n\n\t\tCalculator\n\n"; cout<<"\tEnter Number 1 : "; cin>>a; cout<<"\tEnter Number 2 : "; cin>>b; switch(menu()) { case 1: cout<<"Sum is "<>ch; return ch; }
int add(int a, int b) { return a+b; } int sub(int a, int b) { return a-b; } int mul(int a, int b) { return a*b; } float div(int a, int b) { return (float)a/b; } More useful programs @ http://www.gethugames.in/blog/