Decode School

Decode School - The School for Problem Solvers

Welcome to my blog. Subscribe and get my latest blog post in your inbox.

C Program to Count the digits in the given number.

Sample Input 1 :

734

Sample Output 1 :

3

Program or Solution

					    
							
#include<stdio.h>
int main()
{
	int n,num,count;
	scanf("%d",&num);
	n=num;
	while(num!=0)
	{
		num/=10;
		count++;
	}
	printf("%d digits in %d",count,n);
	return 0;
}
		
					    
					

Program Explanation

refer video tutorial