I want to print string in reverse format:
Input: My name is Archit Patel
My name is Archit Patel
Output: Patel Archit is name My.
Patel Archit is name My
I\'ve tied the
public static string reversewordsInsentence(string sentence) { string output = string.Empty; string word = string.Empty; foreach(char c in sentence) { if (c == ' ') { output = word + ' ' + output; word = string.Empty; } else { word = word + c; } } output = word + ' ' + output; return output; }