Our Recommendation for You Search your Query, You can find easily. for example search by book name or course name or any other which is related to your education

Followers

how to fill and display array using functions

This is the source code of how to fill and display array using functions
                                               
#include<iostream.h>
#include<conio.h>

const int n=9;
int GA[n];


void fillarray(void){
    const int n=9;
    int A[n];
   
    int i=0;
    while(i<=9){
       
        cout<<"value of element"<<i<<"?"<<endl;
        cin>>A[i];
       
        GA[i]=A[i];
        i++;
       
   
    }
   

}


void displayarray(void){

  for(int i=0;i<=9;i++){
     cout<<GA[i]<<endl;
      }   
  }
 



int main()
{
    fillarray();
    displayarray();
    getch();
   
}
End