To print the entire contents of an array, use a looping structure. - C Array

C examples for Array:Array Element

Description

To print the entire contents of an array, use a looping structure.

Demo Code

#include <stdio.h> 

int main() {//w ww .j a  v a2 s  .  co m
   int x;
   int iArray[5];
   //initialize array elements 
   for (x = 0; x < 5; x++)
      iArray[x] = x;
   //print array element contents 
   for (x = 0; x < 5; x++)
      printf("\nThe value of iArray index %d is %d\n", x, x);
}

Result


Related Tutorials