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
what is uses of .net
How do you define a string?
Why are all header files not declared in every c program?
What is a loop?
Can the curly brackets { } be used to enclose a single line of code?
How is pointer initialized in c?
What are the general description for loop statement and available loop types in c?
Write a program to check armstrong number in c?
What is a void pointer in c?
What are the application of c?
What is the difference between NULL and NUL?
Is return a keyword in c?
What does != Mean in c?
What is the significance of c program algorithms?
How to explain the final year project as a fresher please answer with sample project