write a program to display the array elements in reverse
order in c language
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
How to swap two values using a single variable ? condition: Not to use Array and Pointer ?
What is floating point constants?
write a c program to print a given number as odd or even without using loop statements,(no if ,while etc)
What is the difference between File pointer and Internal Charecter Pointer?
Is the exit() function same as the return statement? Explain.
0 Answers Agilent, ZS Associates,
Can u return two values using return keyword? If yes, how? If no, why?
#include <stdio.h> void main() { int i=-1,j=1,k,l; k=!i&&j; l=!i||j; printf ("%d%d",k,l) ; }
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } what will happen if you executed this code?
what will be maximum number of comparisons when number of elements are given?
What are data breakpoints?
main() { char x; while(x=0;x<=255;x++) printf("\nAscii value %d Charater %c",x,x); }
how to use enum datatype?Please explain me?