Write a program which counts for the number of digits in an integer number being
entered by user using:
a. For loop
b. While loop
c. Do while loop
1
Expert's answer
2021-05-14T23:07:18-0400
#include<stdio.h>intmain(){
printf("Enter a number : ");
int n;
int count=0;
scanf("%d",&n);
while(n>0)
{
n=n/10;
count++;
}
printf("\nThe number of digits in entered number is : %d",count);
return0;
}
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments