Traversing an Array

http://install4install.com

The various operations that are performed on arrays are :

Traversing in array

This article explains about how to traverse in an array.

Traversing means to visit/to go/travel across each and every element of an array.

Program

#include<stdio.h>

int main()
{
 int rank[5] = {10,20,30,13,15};
 int i;
 printf("\nThe elements of array are :");
 for(i=0; i<5; i++)
 {
  printf("%d \t", rank[i]); 
 }
return 0;
}

Run

Illustration

Fig 2 : Traversing an Array

Fig 2 : Traversing an Array



Short URL: http://tinyit.cc/c48dd8
Author: Cusp2207 on March 19, 2014
Category: Algorithms, Computer Science, Data Structures
Tags:

Leave a Reply

Last articles