Delicious Digg Facebook Favorites More Stumbleupon Twitter

Thursday 20 September 2012

One dimensional array example 3



   /*  Program to displaying numbers in reverse order */
        #include<stdio.h>
        main()
       {
            int a[10],k;
            clrscr();
            for(k=0;k<10;k++)
           {
                 printf("\nEnter the element for a[%d]:",k);
                 scanf("%d",&a[k]);
           }
                 printf("\nwriting the numbers in the reverse order:\n");
                 for(k=10-1;k>=0;k--)
                 printf("\nthe element in indexa[%d]=%d",k,a[k]);
                 getch();
       }

  
    

0 comments:

Post a Comment