Friday, 3 October 2014

WAP to take input a set of intergers and store them in an array and display in Reverse order.


#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a[20],k,x,i;
printf(" How many no. to be entered ? ");
scanf("%d",&k);
printf("\n\tEnter no. ");
for(i=0;i<k;i++)
{
scanf(" %d",&a[i]);
}
printf("Numbers in Reverse order \n");
x=k-1;
for(x;x>=0;x--)
{
printf(" %d",a[x]);
}
getch();
}

No comments:

Post a Comment

Please write your doubts