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 5 digits in C?

Answer Posted / guest

#include<stdio.h>
int main()
{
int n,sum=0;
printf("enter number");
scanf("%d".&n);
for(int i=0;i<5;i++)
{
sum=sum+(n%10);
n=n/10;
}
printf("sum is %d",sum);
return 0;
}

Is This Answer Correct ?    16 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

3042


What do you understand by friend-functions? How are they used?

1173


What is difference between && and & in c?

1060


`write a program to display the recomended action depends on a color of trafic light using nested if statments

2091


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1921


Give the rules for variable declaration?

1133


What is sizeof int?

1056


How do you search data in a data file using random access method?

1266


What is a void pointer? When is a void pointer used?

1034


What is this infamous null pointer, anyway?

999


What's a good way to check for "close enough" floating-point equality?

1111


Compare interpreters and compilers.

1039


How many keywords (reserve words) are in c?

1101


What are all different types of pointers in c?

974


Explain null pointer.

1055