Site icon T4Tutorials.com

Program of User define function with array in  C++ (C Plus Plus, CPP)  and C with flowchart

Program of User define a function with an array in  C++ (C Plus Plus, CPP)  and C with the flowchart

In this tutorial, we will learn about the followings;

  1. Flowchart of User define a function with an array 
  2. Program of User define a function with the array in  C++ (C Plus Plus, CPP)
  3. Program of User define the function with an array in  C

Flowchart of User define a function with an array 

Coming Soon.

Program of User define a function with an array in  C++ (C Plus Plus, CPP)

#include<iostream>
using namespace std;

void pass(int[],int);
int main()
{
int p[9]={1,2,3,4,5,6,7,8,9};

pass(p,9);
return 0;
}
void pass(int x[],int c)
{
for(int j=0;j<c;j++)
{
cout<<x[j]<<"\n";
}
}

Output

Figure: Program of User define a function with the array in  C++ (C Plus Plus, CPP)  and C with the flowchart.

Program of User define a function with an array in  C

#include<stdio.h>
#include<conio.h>
using namespace std;

void pass(int[],int);
int main()
{
int p[9]={1,2,3,4,5,6,7,8,9};

pass(p,9);
getch();
return 0;
}
void pass(int x[],int c)
{
for(int j=0;j<c;j++)
{

printf(" %d \n" ,x[j]);
}
}

Output

Figure: Program of User define the function with an array in  C++ (C Plus Plus, CPP)  and C with a flowchart.

 

 

 

 

 

 

 

 

Another example of User define function

For more detail about user define a function in C++

Exit mobile version