Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is declaration and definition in c?

1012


What is p in text message?

933


write a program to generate address labels using structures?

4517


Define C in your own Language.

1032


How do I get a null pointer in my programs?

1057


what are the advantages of a macro over a function?

1091


Why do we use & in c?

946


Is there anything like an ifdef for typedefs?

1086


Is fortran still used in 2018?

984


What does void main return?

1064


What do you mean by invalid pointer arithmetic?

999


What is #include called?

994


What are pointers?

1042


Are bit fields portable?

1107


What are disadvantages of C language.

1100