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

if a five digit number is input through the keyboard, write
a program to calculate the sum of its digits.
(hint:-use the modulus operator.'%')

Answer Posted / k.kavitha

main()
{
int num=0,sum=0,k=0;
pirntf("enter the number\n");
scanf("%d",num);
while(num!=0);
{
k=num%10;
sum=sum+k;
num=num/10;
}
printf("%d",sum);
}

Is This Answer Correct ?    137 Yes 90 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does %p mean?

1098


pierrot's divisor program using c or c++ code

2253


What is a char c?

1052


Why do we use static in c?

1142


Why does the call char scanf work?

1216


Difference between linking and loading?

1124


What is dynamic memory allocation?

1347


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

1113


What is const volatile variable in c?

1049


Which built-in library function can be used to match a patter from the string?

1314


what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

1133


Is a house a shell structure?

1174


write a programming in c to find the sum of all elements in an array through function.

2187


If you know then define #pragma?

1119


Is fortran faster than c?

1051