-This page is for begineers in the array.
Array:
Array is the collection of different values having same data type.
-We have a integer Array that having all integer values.
-Character array is known as String.
-Here we Try to Traverse(print) the Array
program-
#include < stdio.h>
int main()
{
int arr[100]; //array
int n,i;
printf("Enter number of element you want in array\n");
scanf("%d",&n);
printf("Enter elements in array\n");
// input of n elements in array
for(i=0;i< n;i++)
{
scanf("%d",&arr[i]);
}
//Now traverse
printf("Your array is \n");
for(i=0;i< n;i++)
printf("%d,",arr[i]);
return 0;
}
Enter number of element you want in array
5
Enter elements in array
3 45 67 12 90
Your array is
3 45 67 12 90