Posts

Showing posts with the label create array

How to create an array in C

 #include<stdio.h> int main() { int i,n,arr[20]; printf("Enter the number of element in the arry \n"); scanf("%d",&n); for(i=0;i<n;i++) { printf("\n arr[%d]=",i); scanf("%d",&arr[i]); } } output: Enter the number of element in the arry 5  arr[0]=1  arr[1]=2  arr[2]=3  arr[3]=4  arr[4]=5