Demlo number ( Square of 11. . .1 ) | C # program to print DemloNumber ; To return demlo number . This function assumes that the length of str is smaller than 10. ; Add numbers to res upto size of str and then add number reverse to it ; Driver program to test printDemlo ( )
using System ; public class GFG { static String printDemlo ( String str ) { int len = str . Length ; String res = " " ; for ( int i = 1 ; i <= len ; i ++ ) res += i . ToString ( ) ; for ( int i = len - 1 ; i >= 1 ; i -- ) res += i . ToString ( ) ; return res ; } public static void Main ( ) { String str = "111111" ; Console . WriteLine ( printDemlo ( str ) ) ; } }