Note: We need an author for this blog. Willing people contact Us......

Thursday, 17 November 2016

C++ Code, Sum of two integers,

# include <iostream>
using namespace std;

long add(long,long);
float add(float,float);

int main ()

{
long a,b,c;
float x,y,z;
cout<<" Enter two integers to get the sum "<<endl;
cin>> a>>b;
c=add(a,b);
cout<<"Sum of the integers is = "<<c<<endl;
cout<<"Enter two floting point numbers to get the sum "<<endl;
cin>>x>>y;
z=add(x,y);
cout<<"sum of the floting point numbers is = "<<z<<endl;
return 0;

}
long add(long a, long b)
{
long sum;
sum=a+b;
return sum;

}
float add(float x, float y)
{
float sum;
sum=x+y;
return sum;
}

No comments:

Post a Comment

Contact us

Name

Email *

Message *