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

praagnovation

0 Answers  


define function

4 Answers   Assurgent, Sonata,


Write a program which has the following seven functions. The functions should be: • main() this calls the other 6 functions • fget_long() a function which returns a long data type from a file • fget_short() a function which returns a short integer variable from a file • fget_float() a function which returns a floating point variable from a file • fprt_long() a function which prints its single, long argument into a file • fprt_short() a function which prints its single, short argument into a file • fprt_float() a function which prints its single, floating point argument into a file. You should use fscanf() to get the values of the variables from the input (the file) and fprintf() to print the values to the other file. Pay attention to using the correct format for each of the data types.

0 Answers  


write a 'c' program to sum the number of integer values

8 Answers  


What is pragma c?

0 Answers  






which is conditional construct a) if statement b) switch statement c) while/for d) goto

0 Answers  


Is sizeof a keyword in c?

0 Answers  


What is the difference b/w main() in C language and main() in C++.

7 Answers  


will the program compile? int i; scanf(“%d”,i); printf(“%d”,i);

3 Answers  


can please someone teach me how to create this program using while statement.. this is the output should look like 0 2 4 6 8 10 -thanks.. :) need it asap...

7 Answers  


Can the size of an array be declared at runtime?

0 Answers  


input any 4 digit number and find the difference of all the digits?

3 Answers   Google,


Categories