#include<iostream>
usingnamespace std;
int sum(int a,int b)
{
return (a+b);
}
int main()
{
cout<<"\nEnter two numbers to add : ";
int x,y;
cin>>x>>y;
if(!sum(x,y))
{
cout<<"\nNot able to Process\nOR\nSum is = 0";
}
else
{
cout<<"\nSum is : "<<sum(x,y);
}
}
#include<iostream>
usingnamespace std;
int sub(int a,int b)
{
return (a-b);
}
int main()
{
cout<<"\nEnter two numbers to subtract :(1st greater than second) ";
int x,y;
cin>>x>>y;
if(!sub(x,y))
{
cout<<"\nNot able to Process";
}
else
{
cout<<"\nDifference is : "<<sub(x,y);
}
}
How can you connect these using another main function
or
how can you include two main functions into another main function ??
------------->(in two other exe files)<----------------