Array Programs

C++ program to print alternate elements from an array

Alternate elements

It means printing every second element from an array.Here is the picture repersentation of the alternate elements.In this picture the arrow targetting to the elements will be printed and other elements will not be printed.

alternate element

  • This program illustrate the concept of printing an alternate element from an array.We have used the very simple logic i.e. “i=i+2” it means each time the for loop will execute program will increment the value of “i” by 2.


alternate elements

Comment below if you are facing any problem.

Also read

Insert an element Into sorted array
C program to enter a element into sorted array