Tuesday, March 5, 2024

27. Count the total number of digits :—

27. Count the total number of digits :—


#include<stdio.h>

int main()

{

    int i,n,count;

    printf("enter value of n ");

    scanf("%d",&n);

    count=0;

    while(n>0)

    {

        n=n/10;

        count++;

    }

    printf("%d",count);

    return 0;

}


No comments:

Post a Comment