Problem Statement : Write a C Program to Find the Number of Digits in an entered number ?
#include<stdio.h> #include<string.h> void main() { int num,digits; char ch[10]; printf("\nEnter the Number : "); scanf("%d",&num); sprintf(ch,"%d",num); digits = strlen(ch); printf("\nNumber of Digits : %d",digits); getch(); }
Output:
Enter the Number : 1234 Number of Digits : 4
Incoming search terms:
- reverse of 3 number using modulus in c (2)
- 3 WAP to find the count of the digit in a number entered by user in c (1)
- reverse a number without using % / operators (1)
- reverse of number without using modulus operator (1)
- sum of digit of a number without using mod operrator (1)
- sum of digits program by using strlen function (1)