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

Answer Posted / dally

#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 ?    52 Yes 48 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

14970


which is an algorithm for sorting in a growing Lexicographic order

1399


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3058


#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }

633


What is wrong with this initialization?

596






what is different between auto and local static? why should we use local static?

646


Explain what are the advantages and disadvantages of a heap?

599


What is difference between scanf and gets?

616


What is the difference between typedef struct and struct?

602


Once I have used freopen, how can I get the original stdout (or stdin) back?

631


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

735


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

650


Explain what header files do I need in order to define the standard library functions I use?

649


Under what circumstances does a name clash occur?

694


Write a C program to count the number of email on text

1422