text: Program to find the Encrypted word | C # program to implement the above approach ; Static function declared to find the encrypted string ; Character array to store the encrypted string ; after ' z ' , it should go to a . ; storing the character array in the string . ; Driver code
code: using System ; class GFG { public static void findWord ( String c , int n ) { int co = 0 , i ; char [ ] s = new char [ n ] ; for ( i = 0 ; i < n ; i ++ ) { if ( i < n / 2 ) co ++ ; else co = n - i ; if ( ( c [ i ] + co ) <= 122 ) s [ i ] = ( char ) ( ( int ) c [ i ] + co ) ; else s [ i ] = ( char ) ( ( int ) c [ i ] + co - 26 ) ; } String str = String . Join ( " " , s ) ; Console . WriteLine ( str ) ; } public static void Main ( String [ ] args ) { String s = " abcd " ; findWord ( s , s . Length ) ; } }