
Call 1800-123-2003
"Smartindia is the best online tool for school students." Ms Deepa Chandran, Principal Anchal
"Smartindia is one of the best supplementary education tool for school students." Ms Pooja, Principal
WRITE A PROGRAM TO READ A POSITIVE INTEGER THEN PRINT THE NO. OF DIGITS IN 125. |
#include <stdio.h> int main() { int n,count=0; printf("Enter an integer: "); scanf("%d", &n); while(n!=0) { n/=10; /* n=n/10 */ ++count; } printf("Number of digits: %d",count); } Note: This is only a hint to help you, try to modify it to get your output. |