C++ Language
#include<iostream.h>
#include<conio.h>
#include<string.h>
void add(int,int);
void add(float,float);
void add(char[],char[]);
void main()
{
int a,b;
float a1,b1;
char a2[20],b2[10];
clrscr();
cout<<"Enter two integer values - ";
cin>>a>>b;
cout<<"\nEnter two float values - ";
cin>>a1>>b1;
cout<<"\nEnter two character values - ";
cin>>a2>>b2;
add(a,b);
add(a1,b1);
add(a2,b2);
getch();
}
void add(int a,int b)
{
int sum;
sum=a+b;
cout<<"\nThe addition of two integer values is - "<<sum;
}
void add(float a,float b)
{
float sum;
sum=a+b;
cout<<"\nThe addition of two float values is - "<<sum;
}
void add(char a[],char b[])
{
strcat(a,b);
cout<<"\nThe concatenation of two characters is - "<<a;
}
/*OUTPUT*/
Enter two integer values -
10
20
Enter two float values -
10.45
20.65
Enter two character values -
Hello
World
The addition of two integer values is - 30
The addition of two float values is - 31.099998
The concatenation of two characters is - HelloWorld