I am very confused how to write a function which can accept 3 input parameter to calculate sum and average.the sum and average should be returned through output parameter ...

pls help ..thx

Recommended Answers

All 3 Replies

Here's a tutorial

Replace every void main() from the tutorial with int main()

Please quote the exact problem because what you posted doesn't make a lot of sense. One possibility is this:

void foo( int a, int b, int c, int*sum, int* average)
{

}
void name(int a,int b,int c,int &sum,int &avg){ }

"&" mean referring a variable , this is a way by which function return more than one value.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.