C program to pass the single dimensional array to the function.

source code:


#include <stdio.h>
#define N 5
void fstore1D(int a[], int a_size);
void fretrieve1D(int a[], int a_size);
void fedit1D(int a[], int a_size);
int main()
{
int a[N];
printf("Input data into the matrix:\n");
             fstore1D(a, N);
fretrieve1D(a, N);
fedit1D(a, N);
fretrieve1D(a, N);
getch();
return 0;
}
void fstore1D(int a[], int n)
{
int i;
for ( i = 0; i < n; ++i )
scanf("%d", &a[i]);
}
void fretrieve1D(int a[], int n){
int i;
for ( i = 0; i < n; ++i )
printf("%6d ", a[i]);
printf("\n");
}

void fedit1D(int a[], int n)
{
int i, q;
for ( i = 0; i < n; ++i )
{
printf("Prev. data: %d\nEnter 1 to edit 0 to skip.", a[i]);
scanf("%d", &q);

Comments

Popular posts from this blog

8086 STRING MANIPULATION –FIND AND REPLACE A WORD

Animated Circles In C++

C program to find out the sum of series 1 + 2 + …. + n.