Skip to content

Instantly share code, notes, and snippets.

@alonzoibarra97
Created February 16, 2016 16:30
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 alonzoibarra97/1a1c6ab38d9f6966c0c3 to your computer and use it in GitHub Desktop.
Save alonzoibarra97/1a1c6ab38d9f6966c0c3 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cmath>
#include <cstdlib>
int suma ( int a, int b)
{
int s;
s=a+b;
return s;
}
int resta ( int a, int b)
{
int r;
r= a-b;
return r;
}
int multiplicacion( int a, int b)
{
int m;
m= a*b;
return m;
}
int division ( int a, int b)
{
int d;
d= a/b;
return d;
}
int moulus ( int a, int b)
{
int ko;
ko =a%b;
return ko;
}
using namespace std;
int main(){
int a, b, s, r, m, d, ko;
cout<< "This program calculates some math operation with to numbers you provide\n";
cout << "Write the first number \n";
cin >> a;
cout << "Write the second number \n";
cin >> b;
s= suma(a, b);
r= resta(a,b);
m= multiplicacion (a,b);
d= division (a,b);
ko= moulus (a,b);
cout<< "The addition of the two numbers is " << s << endl;
cout<< "The substraction of the two numbers is " << r << endl;
cout<< "The multiplicaction of the two numbers is " << m << endl;
cout<< "The division of the two numbers is " << d << endl;
cout<< "The modulus of the two numbers is " << ko<< endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment