You are on page 1of 1

#include <iostream> using namespace std; int funsum(int a, int b, int c){ return a+b+c; } int average(int sum){

return sum/3; } int times(int a, int b, int c){ return a*b*c; } int small_num(int a, int b, int c){ if(a<b and a<c) return a; else if(b<a and b<c) return b; else c; } int larg_num(int a, int b, int c){ if(a>b and a>c) return a; else if(b>a and b>c) return b; else c; } int main() { int a,b ,c,sum,avg,prod,smallest,largest; cout<<"int in:"; cin>>a>>b>>c; sum= funsum(a,b,c); cout<<"sum="<<sum<<endl; avg=average(sum); cout<<"average="<<avg<<endl; prod=times(a,b,c); cout<<"product="<<prod<<endl; smallest=small_num(a,b,c); cout<<"smallest num="<<smallest<<endl; largest=larg_num(a,b,c); cout<<"largest num="<<largest<<endl; return 0; }

You might also like