Find the Mid | C ++ program to find the Mid - Alphabet for each index of the given Pair of Strings ; Function to find the mid alphabets ; For every character pair ; Get the average of the characters ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void findMidAlphabet ( string s1 , string s2 , int n ) { for ( int i = 0 ; i < n ; i ++ ) { int mid = ( s1 [ i ] + s2 [ i ] ) / 2 ; cout << ( char ) mid ; } } int main ( ) { string s1 = " akzbqzgw " ; string s2 = " efhctcsz " ; int n = s1 . length ( ) ; findMidAlphabet ( s1 , s2 , n ) ; return 0 ; }