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

Answers were Sorted based on User's Feedback



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

Answer / bhikshuk patel

Actually i haven't any idea on array in reverse order. If
anyone will give dis answer, i'll be grateful to him/her.
And plz, tell me in brief.
thnk u..

Is This Answer Correct ?    1 Yes 4 No

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

Answer / mak

What if the iputted value of n is greater than the size of
array defined at the beginings????????

Is This Answer Correct ?    9 Yes 19 No

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

Answer / nanda

all the answers r wrong no logic

Is This Answer Correct ?    10 Yes 21 No

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

Answer / jitender

all are wrong....

Is This Answer Correct ?    10 Yes 21 No

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

Answer / dally

in the above of my answer is correct coz in that i am taking
count =0;
so the array will start from last element.

Is This Answer Correct ?    9 Yes 22 No

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

Answer / arpit dhandhania

Answer #2: You have assigned the elements of the array in
the program itself which by default starts from array index
0 that is the numbers goes into the array indices 0 1 2 3
4 and you have not initialzed or modified the value of i in
the first loop which happens to be a garbage or 0 so the
count goes to infinite. coz a[i] is never '\0'
Secondly in a numeric array last element in not null
character it is only in case of character arrays.
Assuming that you have implemented the 1st loop correctly
and you have the length of array a in count ie = 4 since u
are starting from 0 then you have initialized i to count
which makes i = 4.In the second loop the condition is i>=1
so i=0 is never visited and thus a[0] ir not displayed
(remember in C array starts from 0 by default).

Is This Answer Correct ?    5 Yes 20 No

Post New Answer

More C Interview Questions

How is pointer initialized in c?

0 Answers  


Explain indirection?

0 Answers  


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

0 Answers  


how we can say java is platform independent, while we require JVM for that particular Operating System?

3 Answers   Honeywell, TCS,


What is an operator?

0 Answers  






#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} what would be the output?

1 Answers   Wipro,


Is both getch() and getchar() functions are similar? if it is similar means why these two functions are used for same usage? if it is not similar means what is the difference?

1 Answers   Infosys,


What is the difference between %d and %i?

0 Answers  


what will be the output of this program........ main() { int a=2,b=4,c=6; printf("%d"); } why it gives the value of third variable.

6 Answers   HCL,


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

0 Answers  


1. main() { printf("%d",printf("HelloSoft")); } Output?

3 Answers   HCL,


What is the difference between big endian form and little endian form? write a code to convert big endian form to little endian and vice versa..

5 Answers   Aricent, TCS,


Categories