Skip to content

Instantly share code, notes, and snippets.

@batmantec
Created February 4, 2016 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save batmantec/ea5b00180c06988e72ab to your computer and use it in GitHub Desktop.
Save batmantec/ea5b00180c06988e72ab to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int sum(int a, int b)
{
int c;
c=a+b;
return c;
}
int dif (int a, int b)
{
int e;
e=a-b;
return e;
}
int product (int a, int b)
{
int f;
f=a*b;
return f;
}
int div (int a, int b)
{
int g;
g=a/b;
return g;
}
int rem (int a, int b)
{
int h;
h=a%b;
return h;
}
int main()
{
int a,b,d,e,f,g,h;
cout<<"Give me the first integer number: ";
cin>>a;
cout<<"Give me the second integer number: ";
cin>>b;
d=sum (a,b);
e=dif(a,b);
f=product (a,b);
g=div(a,b);
h=rem(a,b);
cout<<"------------------------------------------------------"<<endl;
cout <<"The sum of the numbers is: "<<d<<endl;
cout<<"------------------------------------------------------"<<endl;
cout<<"The rest of the numbers is: "<<e<<endl;
cout<<"------------------------------------------------------"<<endl;
cout<<"The multiplication of the two numbers is: "<<f<<endl;
cout<<"------------------------------------------------------"<<endl;
cout<<"The division of the two numbers is: "<<g<<endl;
cout<<"------------------------------------------------------"<<endl;
cout<<"The remainder of the division is: "<<h<<endl;
cout<<"------------------------------------------------------"<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment