Monday, June 25, 2018

Program that read the array of integer and print array elements in reverse order - DS (C Program)

#include<stdio.h>
void main()
{
int a[5],length=0,i;
int *p=&a[0],*t;
clrscr();
printf("Enter value of Array:\n");
for(i=0;i<5;i++)
{
scanf("%d",p);
p++;
}
p--;
printf("Reverse of Array:\n");
for(i=0;i<5;i++)
{
printf("%d\n",*p);
p--;
}
getch();
}

No comments:

Post a Comment