Posted on Leave a comment

‘C’ Array program

‘C’ Array program

  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int array[100], n, c;
  5.     printf(“Enter number of elements in array\n”);
  6.     scanf(“%d”, &n);
  7.     printf(“Enter %d elements\n”, n);
  8.     for (c = 0; c < n; c++)
  9.         scanf(“%d”, &array[c]);
  10.     printf(“The array elements are:\n”);
  11.     for (c = 0; c < n; c++)
  12.         printf(“%d\n”, array[c]);
  13.     return 0;
  14. }
Leave a Reply

Your email address will not be published. Required fields are marked *