Vidyalelo
Data Structure · Q329

Miscellaneous on Data Structures

Programming · Data Structure · question 329

Q329

What is the output of the following code? #include #include void reverse_string(char *s) int len = strlen(s); int i,j; i=0; j=len-1; while(i < j) char tmp = s[i]; s[i] = s[j]; s[j] = tmp; i++; j--; int main() char s[100] = "reverse"; reverse_string(s); printf("%s",s); return 0;

A.
ersevre
B.
esrever
Answer
C.
eserver
D.
eresevr

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board