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 / jegadeesh

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
scanf("%d",&i);
if((i%9)==0)
printf("The sum of digit is 9");
else
{
j=i%9;
printf("%d",j);
}
}

Is This Answer Correct ?    29 Yes 33 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c have an equivalent to pascals with statement?

957


How can I copy just a portion of a string?

1270


how to write optimum code to divide a 50 digit number with a 25 digit number??

3202


How many levels of pointers have?

986


What is .obj file in c?

1018


Why header files are used?

1061


What is || operator and how does it function in a program?

1039


Are comments included during the compilation stage and placed in the EXE file as well?

1027


which type of aspect you want from the student.

2112


What is an auto variable in c?

1166


In c programming, explain how do you insert quote characters (? And ?) Into the output screen?

1196


What are derived data types in c?

1007


Can a local variable be volatile in c?

933


What is the difference between int main and void main in c?

1091


Explain built-in function?

1086