C Program to Print Array in Reverse Order
/*
Write a program to read array of integers and print it in reverse order
*/
#include <stdio.h>
int main(void)
{
int a[10],i,n=10;
for(i=0;i<n;i++)
{
printf("Enter Value at a[%d] : ",i);
scanf("%d",&a[i]);
}
for(i=n-1;i>=0;i--)
{
printf("\n Enter Value at a[%d] : %d ",i,a[i]);
}
return 0;
}
Write a program to read array of integers and print it in reverse order
*/
#include <stdio.h>
int main(void)
{
int a[10],i,n=10;
for(i=0;i<n;i++)
{
printf("Enter Value at a[%d] : ",i);
scanf("%d",&a[i]);
}
for(i=n-1;i>=0;i--)
{
printf("\n Enter Value at a[%d] : %d ",i,a[i]);
}
return 0;
}
Comments
Post a Comment