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;
- Flowchart of User define a function with an array
- Program of User define a function with the array in C++ (C Plus Plus, CPP)
- 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)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#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

Program of User define a function with an array in C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#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
