In this program, we take some input to an array and then show its content.
#include <stdio.h>
int main()
{
int arr[5]; // array
int i; // loop var
printf("Enter elements of the array - \n");
for(i=0;i<5;i++)
{
scanf("%d",&arr[i]);
}
printf("Content of the array - \n");
for(i=0;i<5;i++)
{
printf("%d \n",arr[i]);
}
return 0;
}
OUTPUT:
Enter elements of the array -
5
10
15
20
25
Content of the array -
5
10
15
20
25
Array programs
- Sequence filter in array in C
- Array Search (Linear search)
- Array Merging
- Array Sorting
- C program to take marks and show percentage accordingly.
- C program to take user input to an array and show its content.
- C program to search an element in the array using a user – defined function.
- C program to search an element in the array using bsearch() function.
- C program to sort an array using qsort() functions.
- Recursive binary search in C.
Trending