Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

C Program to Count Number of Digits in a Number

/* C Program to Count Number of Digits in a Number using While Loop */
#include <stdio.h>

int main()
{
  int Number, Reminder, Count=0;

  printf("
 Please Enter any number
");
  scanf("%d", &Number);

  while(Number > 0)
  {
     Number = Number / 10;
     Count = Count + 1;  
  }

  printf("
 Number of Digits in a Given Number = %d", Count);
  return 0;
}
Source by www.tutorialgateway.org #
 
PREVIOUS NEXT
Tagged: #C #Program #Count #Number #Digits #Number
ADD COMMENT
Topic
Name
6+8 =