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...

write a program to sum of its digit with using control
structure or with out using loop. for ex: let the number is
25634 then answer will be=2+5+6+3+4=20

Answer Posted / thiruapthi rao

// mainlogic
while(number>0)
{
remainder=number%10;
sum=sum+remainder;
number=number/10;
}
/*
number=123
sum=1+2+3=6
*/

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to know whether the input number is an armstrong number.

1090


How can you convert integers to binary or hexadecimal?

998


What is the size of structure pointer in c?

1036


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1909


What does struct node * mean?

991


What is maximum size of array in c?

1014


What is the use of the function in c?

993


List the different types of c tokens?

1037


Write a program to find the biggest number of three numbers in c?

1026


Are negative numbers true in c?

1029


Write a program to check armstrong number in c?

1106


Write a program to implement queue.

1090


What language is windows 1.0 written?

1012


What is meant by inheritance?

1066


How can I find out how much free space is available on disk?

1032