1#include <iostream>
2using namespace std;
3
4int main() {
5
6 string greeting = "Hello";
7 int len = greeting.length();
8 int n = len-1;
9 int i = 0;
10 while(i<=n){
11 //Using the swap method to switch values at each index
12 swap(greeting[i],greeting[n]);
13 n = n-1;
14 i = i+1;
15
16 }
17 cout<<greeting<<endl;
18}