#include<iostream.h>
#include<stdio.h>
#include<conio.h> 

/* Function arguments are of different data type */

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

int main()
{
 long a, b, x;
 float c, d, y;
 clrscr();

 cout << "Enter two integers number\n";
 cin >> a >> b;

 x = add(a, b);

 cout << "Sum of integers number : " << x << endl;

 cout << "Enter two floating point numbers\n";
 cin >> c >> d;

 y = add(c, d);

 cout << "Sum of floating number: " << y << endl;
 getch();
 return 0;
}

long add(long x, long y)
{
 long sum;

 sum = x + y;

 return sum;
}

float add(float x, float y)
{
 float sum;

 sum = x + y;

 return sum;
}
OUTPUT
Enter two integers number : 
3
4 
Sum of integers number : 7
Enter two floating point numbers :
5.5
4.6
Sum of floating number : 10.1

Leave a Reply

Subscribe to Posts | Subscribe to Comments

All Notes on BCA

All Notes  on BCA
BCA all subjects notes

Total Pageviews

Translate

Powered by Blogger.

Copyright © All Notes on BCA