Blog Moved

This website completely moved to new domain. For latest content, visit www.programmingposts.com

Search This Blog

6 May 2013

C PROGRAM TO PRINT THE ELEMENTS OF ARRAY IN REVERSE ORDER

C PROGRAM TO PRINT THE ELEMENTS OF ARRAY IN REVERSE ORDER

#include<stdio.h>
#define MAX 25 //maximum size of array is 25

main()
{
  int i,n,arr[MAX];

  printf(" *** C PROGRAMS BLOG ***");
  printf("\n >>> Program to Print the element of array in Reverse Order<<<");
  printf("\n\n Enter the size of array: ");
  scanf("%d",&n); //taking size of array as input from user
  printf("\n Enter the %d elements of array: \n",n);
  
  //taking input all the elements of array using for loop
  for(i=0;i<n;i++)
  {
   printf("\n arr[%d]:",i+1);
   scanf("%d",&arr[i]);    
  }
   printf("\n The Elements of Array in Reverse order are : \n");
   
    //Printing the elements of array in reverse order
   for(i=n-1;i>=0;i--)
   {
    printf(" %d ",arr[i]);   
   }
   getch();
}

Sample Output :



14 comments:

  1. Hi, Nice C program to print the elements of array in reverse order.Thanks, its really helped me......

    -Aparna
    Theosoft

    ReplyDelete
  2. Find the all solutions and tutorials of "c programming" follow this link http://www.cprogramming-bd.com/c_page.aspx

    ReplyDelete
  3. Good
    Here is a link for C/C++ programs and pointer programs. This may be useful for you.

    C/C++ Programs

    ReplyDelete
  4. thanks for creating a nice post on c programming but did you know what is conditional statement in c programming

    ReplyDelete
  5. hi welcome to this blog.its really informative blog.thank you for sharing this blog.
    c programming training

    ReplyDelete
  6. Thanks for sharing your experience. Very helpful for learners. c programming classes in pune

    ReplyDelete
  7. It is told that c programming is the mother of all languages. c programming is used in most of the important sectors. All the operators are made by c programming . So, it is very important to learn c programming .
    In my website c programming is taught in very easy way. You will get videos too in my website ltslearn.com.

    ReplyDelete
  8. It is told that c programming is the mother of all languages. c programming is used in most of the important sectors. All the operators are made by c programming . So, it is very important to learn c programming .
    In my website c programming is taught in very easy way. You will get videos too in my website ltslearn.com.

    ReplyDelete
  9. Very informative blog!

    Please take some time to visit my blog @
    loop in C notes

    Thanks!

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete