Menus

Tuesday 20 April 2021

C program to Count the Number of Digits





#include<stdio.h>


void main(){


int n,count=0;


printf("Enter an number ");

scanf("%d",&n);


while(n>0)

{

  

  n=n/10; 

  count++;

 

}


printf("Number of digits %d", count);

 


}


 

No comments:

Post a Comment