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

how to find sum of digits in C?

Answer Posted / leninraj

main()
{
int n,i,sum=0,r;
printf("enter the value");
scanf("%d",&n);
for(i=0;i<=5;i++)
{
r=n%10;
n=n/10;
sum=sum+r;
}

Is This Answer Correct ?    57 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of this pointer?

1462


What is %d called in c?

1284


Does c have function or method?

1064


What is the use of extern in c?

1153


Write a code on reverse string and its complexity.

1095


‎How to define structures? · ‎

1149


Why c is a procedural language?

1133


What is the -> in c?

1070


What do you know about the use of bit field?

1101


How can I remove the leading spaces from a string?

1215


What is difference between array and structure in c?

1272


What happens if a header file is included twice?

1081


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

1074


What is nested structure?

1100


What tq means in chat?

1175