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