We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Friday, May 22, 2015

Enter the Integers and find the how many numbers has been entered?

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace FindNumber

{
class Program


{
 static void Main(string[] args)

{
int n, count = 0;


Console.WriteLine("Enter an Integer");

n = int.Parse(Console.ReadLine());

while (n != 0)

{
n = n/10;

count++;

}
Console.WriteLine(count);


Console.ReadLine();

}

}

}

  output:

No comments: