by Dinesh Thakur Category: Functions

 

#include<iostream.h>

#include<conio.h>
int average (int, int, int) ;
int main ()
{
             int a,b,c,r;
             clrscr();
             cout<<"Enter three numbers :";
             cin>>a>>b>>c;
              r=average(a,b,c);
             cout<<"The average of three numbers is: "<<r;
             getch();
          return 0;
}
              int average(int x,int y,int z)
             {
                   int avg;
                           avg = (x+y+z)/3;
                   return avg;
             }

demonstrate the concept of functions returning values



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles