• Now Online : 81
  • admin@codemyne.net

Introduction

The program counts the numbers of a number. For example take the number 76453, the program counts the total numbers in that numbers and gives output as 5.

#include<stdio.h>
#include<conio.h>
void main()
{
        int num,count=0;
    printf("/n Enter a number:");
    scanf("%d",&num);
    for( ; num!=0; num=num/10)
    {
        count++;
    }
    printf("/n Total number of digits are %d",count);
    return 0;
}

Comments/Suggestions are invited. Happy coding......!

Comments Post a Comment