Array Programs

C program to print alternate elements from an array

Alternate elements

This program illustrate the concept to print a alternate elements from an array.Array stores the element in contiguous memory location.Users can input only one data type of elements in the array at one time.

  • We have first defined the size of array i.e. “x[100]”.
  • After getting the size of array users will enter the elements in array
  • Once user will enter all the elements.Program will give output using logic “i=i+2”.

OUTPUT:-

Alternate elements


Inserting element into sorted array

Inserting element into sorted array