Any one liner code ?


   public static void main()
        {
            //looking better code below problem
            //the house numbers along jefferson street 1 through 120.
            //how many digits there house numbers..
            int digitcount = 0;
            (int = 1; <= 120; i++) digitcount += i.tostring().length;
            console.writeline(digitcount);
        }

you use:

int digitcount = enumerable.range(1, 120).sum(i => i.tostring().length);



reed copsey, jr. - http://reedcopsey.com
if post answers question, please click "mark answer" on post , "mark helpful".




Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

SQL Server 2008 - High Memory Usage

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

Problem In Configuring Biztalk 2009 In Creating A ReceivePort.When I Try To Create A Receive POrt I Got This Error