function for calculating the encryption
static void cipher ( String str ) { for ( int i = 0 ; i < str . Length ; i ++ ) { if ( ! char . IsLetter ( str [ i ] ) && str [ i ] != ' ▁ ' ) { Console . WriteLine ( " Enter ▁ only ▁ alphabets ▁ and ▁ space " ) ; return ; } } Console . WriteLine ( " Encrypted ▁ Code ▁ using ▁ Latin ▁ Alphabet " ) ; for ( int i = 0 ; i < str . Length ; i ++ ) { if ( str [ i ] >= ' A ' && str [ i ] <= ' Z ' ) { Console . Write ( str [ i ] - ' A ' + 1 + " ▁ " ) ; } else if ( str [ i ] >= ' a ' && str [ i ] <= ' z ' ) { Console . Write ( str [ i ] - ' a ' + 1 + " ▁ " ) ; } if ( str [ i ] == ' ▁ ' ) Console . Write ( str [ i ] ) ; } Console . WriteLine ( ) ; }