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

Answer Posted / pandia

#include<stdio.h>
int main()
{
int a[]={1,2,3,7,8};
int count=0,i;
while(a[i] != '\0')
{
count++;
}
for(i=count;i>=1;i--)
{
printf("%d",a[i]);
}
}

Is This Answer Correct ?    33 Yes 28 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is putchar() function?

623


Explain what is the benefit of using #define to declare a constant?

600


What is scanf () in c?

655


Apart from dennis ritchie who the other person who contributed in design of c language.

801


What is %d called in c?

748






why return type of main is not necessary in linux

1695


What are the different types of objects used in c?

565


What is the purpose of scanf() and printf() functions?

709


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

1779


What is the -> in c?

571


What is the purpose of main() function?

648


Explain what is the use of a semicolon (;) at the end of every program statement?

721


FILE PROGRAMMING

1771


Is c easier than java?

562


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1617