Quote:
The program works fine , but i want also for num " 0 " to print me that it has 1 digit , cause it prints it has 0.
You code works for any cases but 1 specific case.
Solution , add specific code to handle this specific case.
#include<stdio.h>
int main()
{
int num , count=0;
scanf("%d",&num);
while(num)
{
num=num/10;
count++;
}
printf("The number has %d digits",count);
return 0;