This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

averege

int averege4( int a , int b , int c , int d )
{ return ( averege3 ( a , b , c ) + d) / 2;
}

int averege3( int a , int b , int c )
{ return ( averege2 ( a , b ) + c) / 2;
}

int averege2( int a , int b )
{ return ( averege1 ( a ) + b) / 2;
}

int averege1( int a )
{ return ( 0 + a / 2 );
}

why do the result is wrong?

Parents
  • No. Your program does not seem to work - at least not if you want it to produce the average of 1, 2, 3 or 4 values.

    Next thing - how can you claim "why do the result is wrong?" if your original attempt didn't even have any main()? Your original program couldn't even produce any result at all without a main().

Reply
  • No. Your program does not seem to work - at least not if you want it to produce the average of 1, 2, 3 or 4 values.

    Next thing - how can you claim "why do the result is wrong?" if your original attempt didn't even have any main()? Your original program couldn't even produce any result at all without a main().

Children