How to Count digit Enter by user in C#

How to Count Digit Enter By User in C# Programing Language..

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace countdigit
{
    class Program
    {
        static void Main(string[] args)
        {
            int num;
            int count = 0;
            Console.WriteLine("enter the digit");
            num = Convert.ToInt32(Console.ReadLine());
            while(num!=0)
            {

                num = num / 10;
                count++;
               
            }
                Console.WriteLine("the digit is:" + count);
            }
    }
}

Output :



See Other Tutorial :

*  AngularJS Crude With ASP.NET MVC

*  Convert Rows to columns using 'Pivot' in SQL Server

*  Mvc Registration page With user exist using Ajax method

*  MVC 4 How to Perform Insert Update Delete Edit Select Operation

*  MVC4 Edit,update,Delete,cancel inside gridview using sql database

*  MVC 4 Gridview To Display Data Using SQL Server Database With Simple code 

*  Login page in asp.net Mvc4 Web application

*  Mvc4 How to bind Dropdown List using Sql Database

Gridview find control in asp.net
Previous
Next Post »