C++ | Printing numbers in reverse from arrays


This post will teach you to print the numbers in reverse order from arrays in c++. The program given below does so. You can extend the program, look at extending it section given below. Go enjoy the program. Lets begin…….

Program to print numbers in reverse from arrays

void main()
//clear the screen.
//declare variable type int
int a[10],i;
//Input the two numbers save them in arrays.
//Here for loop is used to input multiple numbers in array.
cout<<“Enter the no.”<<endl;
//show the output arrays
cout<<a[i]<<” “;
//get character


Enter the no.
Enter the no.
Enter the no.
Enter the no.
Enter the no.
5 4 3 2 1

How does it work

  1. You enter the number.
  2. The number is saved in respective array.
  3. The numbers are printed in reverse.

Extending it

The program can be extended by using char in place of int.


  1. Include ‘iostream.h’ and ‘conio.h’ files.
  2. Add void main.
  3. Start program by first clearing the screen.
  4. Declare the variables as int (name them as you want.)
  5. Add the cout and cin of array.
  6. Print the array.

At the end

You learnt creating the C++ program of Printing numbers using arrays in reverse order. So now enjoy the program.

Please comment on the post and share it.
And like it if you liked.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s