Posts

Showing posts with the label C Count digits

C Program to count the number of digits entered

Image
 // C Program to count the number of digits entered #include <stdio.h>  //header file declaration int main()  //main method {      int p, count=0;            // variable declaration      printf("Input Number--");            //Display input number     scanf("%d",&p);                                   while(p!=0)                                         {          p=p/10;          count++;      }      printf("\nThe number of digits are: %d",count);                ...