By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 795 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

How to solve call of nonfunction in function main[]

P: n/a
this is sample of my program
Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<conio.h>
  3. #define n 5
  4.  
  5. int total(int number);
  6. int average(int average, int total);
  7. void min_max(int number[5],int &min,int &max);
  8.  
  9. void main(){
  10. int i;
  11. int number[5],total,average,max,min;
  12.  
  13. cout<<"enter 5 number= \n";
  14. for(i=0;i<5;i++)
  15. cin>>number[i];
  16.  
  17. total(number);
  18. average(total,average);
  19. min_max(number,max,min);
  20.  
  21. getche();
  22. }
  23.  
  24.  
  25. int total(int number[5]){
  26. int i,tot;
  27. return tot=tot+number[i];
  28. }
  29.  
  30. int average(int tot, int average){
  31. int ave;
  32. return ave=tot/5;
  33. }
  34.  
  35. void min_max(int number[5],int &A,int &B){
  36. int i;
  37.  
  38. for(i=0;i<5;i++){
  39.  
  40. if(number[5]>A)
  41. A=number[5];
  42.  
  43. else
  44. B=number[5];
  45. }
  46. cout<<"max="<<A;
  47. cout<<"min="<<B;
  48.  
  49. }
my question is how to solve call of nonfunction in function main[]...i do not understand what it means...
Oct 17 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.