C Program To Print/Read Array Elements

C Program To Print/Read Array Elements

#include<stdio.h>

int main()
{

   int i, arr[30], num;

   printf("Enter no of elements :\n");
   scanf("%d", &num);  //input from user


   printf("Enter the values :\n");

   for (i = 0; i < num; i++)
   {
      scanf("%d", &arr[i]);   //elements entry in array
   }


   for (i = 0; i < num; i++)
   {
      printf("arr[%d] = %d\n", i, arr[i]);  //print array element
   }

}

Copyright © C Program | Java | OpenGL Programming | Hadoop at Computaholics