Write a program to obtain a number (N) from the user and display whether the number is a one digit number, 2 digit number, 3 digit number or more than 3 digit number
#include <iostream>
using namespace std;
int main()
{
int N, count = 0, digit;
cin >> N;
while (N > 0)
{
digit = N % 10;
N = N / 10;
count++;
}
if (count == 1)
{
cout << "1";
}
else if (count == 2)
{
cout << "2";
}
else if (count == 3)
{
cout << "3";
}
else
cout << "More than 3 digits";
}