How to solve call of nonfunction in function main[]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pecca

    #1

    How to solve call of nonfunction in function main[]

    this is sample of my program
    Code:
    #include<iostream.h>
    #include<conio.h>
    #define n 5
    
    int total(int number);
    int average(int average, int total);
    void min_max(int number[5],int &min,int &max);
    
    void main(){
    int i;
    int number[5],total,average,max,min;
    
    cout<<"enter 5 number= \n";
    for(i=0;i<5;i++)
    cin>>number[i];
    
    total(number);
    average(total,average);
    min_max(number,max,min);
    
    getche();
    }
    
    
    int total(int number[5]){
    int i,tot;
    return tot=tot+number[i];
    }
    
    int average(int tot, int average){
    int ave;
    return ave=tot/5;
    }
    
    void min_max(int number[5],int &A,int &B){
    int i;
    
    for(i=0;i<5;i++){
    
    if(number[5]>A)
    A=number[5];
    
    else
    B=number[5];
    }
    cout<<"max="<<A;
    cout<<"min="<<B;
    
    }
    my question is how to solve call of nonfunction in function main[]...i do not understand what it means...
    Last edited by MMcCarthy; Oct 17 '10, 10:46 PM. Reason: added code tags
Working...