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 for(int i=0;i<(len/2);i++){
10 //Using the swap method to switch values at each index
11 swap(greeting[i],greeting[n]);
12 n = n-1;
13
14 }
15 cout<<greeting<<endl;
16}