Skip to content

Instantly share code, notes, and snippets.

@Aathi03
Created April 1, 2017 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aathi03/b4a6f9776bdafdd6634a276e10a205d4 to your computer and use it in GitHub Desktop.
Save Aathi03/b4a6f9776bdafdd6634a276e10a205d4 to your computer and use it in GitHub Desktop.
counting number of digits
#include<stdio.h>
int main()
{
int a,count=0;
printf("enter the input number");
scanf("%d",&a);
while(a!=0)
{
a=a/10;
count++;
}
printf("\nNo of digits=%d",count);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment