You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
392 B

/* Reverses a series of numers (pointer version)
*
* reverse3.c
*
* Created on: Jun 9, 2013
* Author: delmadord
*/
#include <stdio.h>
#define N 10
int main(void) {
int a[N], *p;
printf("Enter %d numbers: ", N);
for (p = a; p < a + N; p++)
scanf("%d", p);
printf("In reverse order: ");
for (p = a + N - 1; p >= a; p--)
printf(" %d", *p);
printf("\n");
return 0;
}