Recent

Comments

Follow us on Facebook

Sunday 24 December 2017

1. Write a function that is called by function main () and receives five integers. The function should print the sum of five integers and return the average to main. The average is printed in main.

#include <iostream>
using namespace std;
main()
{
int avg (int,int,int,int,int);
int a,b,c,d,e,z;
cout<<"\nenter the five number for sum and avg  ";
cin>>a>>b>>c>>d>>e;
z=avg(a,b,c,d,e);
cout<<"\nthe avg of five number is   =      "<<z;

}
int avg (int s,int t,int u,int v,int r)
{
int sum,avg;
sum=s+t+u+v+r;

avg=sum/5;
    cout<<"\nsum is     =         "<<sum;
return avg;
}

0 on: "1. Write a function that is called by function main () and receives five integers. The function should print the sum of five integers and return the average to main. The average is printed in main. "

Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix.

Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix. ...

propeller ads

PropellerAds