//The program does simple calculations like add and sub
#include <iostream>
#include <cstdlib>
using std::cout;
using std::cin;

int dosum(int a,int b);
int dosub(int a,int b);


int main()
{
char ans;
int a,b;
    
cout<<"What type of operation do wish to perform? enter a for additions or s for subtraction\n";
cin>>ans;
    if(ans!='a'&& ans!='s')
    {
cout<<"You entered the wrong answer for the opration to be performed\n";
        
    exit(1);   /*the program exits if the user enters a wrong     specification for operation*/
}
cout<<"Input the two numbers\n";
cin>>a, cin>>b;


if (ans=='a'||ans=='A')
{
cout<<"The sum of the two numbers entered is "<<dosum(a,b)<<" \n";
}
else if(ans=='s'||ans=='S')
{
cout<<"The difference of the two numbers is "<<dosub(a,b)<<" \n";
}

return 0;
}

int dosum(int a,int b)
{
 return a+b;
}

int dosub(int a,int b)
{
return a-b;
}
