Testing.

Sunday, 1 January 2017

C programming language: write a C program to count number of digits of given integer.




#include<stdio.h>
#include<conio.h>
void main()
{
int count=0,rem,num,n;
printf("\nEnter Numbers: ");
scanf("%d",&num);
n=num;
while(num)
{
rem=num%10;
count=count+1;
num=num/10;
}
printf("\nIn %d Having %d Digits...",n,count);
getch();
}


No comments:

Post a Comment