.
Home About-us Privacy Policy Contact-us Services

Friday, October 9, 2015

C++ Program to concept of function overloading with different data type

ad+1

Program -


#include<iostream.h>
#include<conio.h>
int average(int a,int b,int c);
void main()
{
clrscr();
int a,b,c;
int average(int,int,int);
cout<<"enter the integer values:"<<endl;
cin>>a>>b>>c;
cout<<"a="<<a<<"b="<<b<<"c="<<c;
average(a,b,c);
cout<<endl;
getch();
}
int average(int a,int b,int c)
{
int av;
av=(a+b+c)/3;
cout<<"\n average of three integer no is:"<<av<<endl;
return(av);
}

Output - 

enter the integer values:
6 8 4
a=6b=8c=4
average of three integer no is:6









0 comments:

Post a Comment

Home About-us Privacy Policy Contact-us Services
Copyright © 2014 All Programs Examples | All Rights Reserved. Blogger Templates Download Blogger Templates