Thu Nov 13, 2008 3:08 pm
#include <stdio.h>
// Read in the indicated number of numbers, then print them backwards.
void rne(int arr[], int size)
{
for(int i = 0; i < size; ++i)
scanf("%d", &arr[i]);
printf("----------------------------------------------------\n");
int i;
for(i = size-1; i >= 0; --i)
printf("%d ", arr[i]);
printf("\n----------------------------------------------------\n");
}
main()
{
// Allocate with new C99 variable-sized arrays.
int size;
scanf("%d", &size);
int arr[size];
rne(arr, size);
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.