write a program to display the array elements in reverse
order in c language

Answer Posted / tej

#include<stdio.h>
#include<conio.h>
void main()
{
int a[],n;
printf("enter array size");
scanf("%d",&n);
printf("enter elements of an array");
for(i=0;i<n;i++)
{
scanf("%d",a[i]);
}
for(i=1;i<=n;i++)
{
printf("%d",a[n-i]);
}
getch();
}

Is This Answer Correct ?    7 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When should you use a type cast?

594


What is a void * in c?

598


How can I write functions that take a variable number of arguments?

627


Describe the order of precedence with regards to operators in C.

634


Can math operations be performed on a void pointer?

590






Why is sprintf unsafe?

620


What is the difference between volatile and const volatile?

566


Write a code to generate divisors of an integer?

643


What does printf does?

749


Why do we use int main instead of void main in c?

624


How is null defined in c?

653


What is cohesion in c?

543


What are identifiers in c?

636


What is pass by reference in c?

616


When c language was developed?

643