Computer Science, asked by mansooralam0888, 11 months ago

write a program to input an integer number.print whether the input integer is a single digit number or double digit number or triple digit number or higher digits number.

Answers

Answered by roymananjay
0

Answer:

#include <iostream>

using namespace std;

int main()

{

int n;

int c=0;

cout<<"Enter a number to check the number is single digit, double digit, triple digit or higher :- \n";

cin>>n;

while(n>0)

{

n=n/10;

c=c+1;

}

switch(c)

{

case 1:

cout<<"the number is single digit";

break;

case 2:

cout<<"the number is double number ";

break;

case 3:

cout<<"the number is triple number ";

break;

default:

cout<<"the number is higher";

}

return 0;

}

Attachments:
Similar questions