I have to display the numbers in reverse order but i get an error program terminated to "Segmentation fault"(11).
My code:
#include<stdio.h>
void main()
{
int a,b[100],i;
printf("Enter the total numbers:\n");
scanf("%d",&a);
printf("Enter the numbers:\n");
for(i=0;i<a;i++)
{
scanf("%d",&b[i]);
}
for(i=a-1;i>=0;i++)
{
printf("%d\n",b[i]);
}
}