• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

UGC-NET | UGC NET CS 2018 Dec – II | Question 41

Consider the C/C++ function f() given below:
void f(char w [ ] )
{
 int x = strlen(w); //length of a string
 char c;
 For (int i = 0; i < x; i++)
  {
    c = w[i];
    w[i] = w[x - i - 1];
    w[x - i - 1] = c;
  }
} 
Which of the following is the purpose of f() ?

(A)

It output the content of the array with the characters rearranged so they are no longer recognized a the words in the original phrase.

(B)

It output the contents of the array with the characters shifted over by one position.

(C)

It outputs the contents of the array in the original order.

(D)

It outputs the contents of the array in the reverse order.

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments