Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // C program to count number of digits in a number
- #include<stdio.h>
- int main(){
- int count=0,n;
- printf("ENTER A NUMBER : ");
- scanf("%d",&n);
- while(n != 0){
- n=n/10;
- count++;
- }
- printf("NUMBER OF DIGIT IS : %d\n",count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment