wap in c to accept a number display the total count of digit
Answer Posted / santhi perumal
#include<stdio.h>
#include<conio.h>
int main()
{
int number,m,sum =0,count =0;
printf("Enter the number \n");
scanf("%d",&number);
while(number != 0)
{
m = number % 10;
sum = sum + m;
count++;
number = number / 10;
}
printf("\nThe number of Digits in the Given Number is
%d\n",count);
printf("The Sum of Digits in the Given Number is %d\n",sum);
}
Is This Answer Correct ? | 19 Yes | 5 No |
Post New Answer View All Answers
write a programming in c to find the sum of all elements in an array through function.
Define circular linked list.
What is binary tree in c?
Explain about the functions strcat() and strcmp()?
Is main an identifier in c?
What is the explanation for the dangling pointer in c?
explain what is fifo?
What does s c mean on snapchat?
c program to compute AREA under integral
Can an array be an Ivalue?
main() { printf("hello"); fork(); }
how to construct a simulator keeping the logical boolean gates in c
Does c have enums?
Explain how do you generate random numbers in c?
What is a struct c#?