
Linear Data Structure 471
int sim[5] , j ;
c l r s c r ( ) ;
p rin t f ("\nEnter fiv e elements : " ) ;
fo r (j= 0 ;j< 5 ;j+ + )
scanf ( "%d", &sim [ j ] ) ;
p rin tf ("\n L is t : " ) ;
fo r ( j= 0 ;j< 5 ;j+ + )
p rin tf (" %d ”, aim[j ] ) ;
p r in tf ("\n Reverse L ist : " ) ;
fo r (j = 4;j >=0;j - - )
p r in tf (" %d " , s i m [ j ] ) ;
}
o u t p u t;
Enter five elements: 1 5 9 7 3
List : 1 5 9 7 3
Reverse List: 3 7 9 5 1
Explanation The above program is simple. Using simple declaration of an array a list can be
implemented. Using for loop and scan f () statements five integers are entered. The list can