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:
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:
Post a Comment