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

How can I copy just a portion of a string?

1287


how to find anagram without using string functions using only loops in c programming

3155


What is typedef example?

1144


What is the difference between constant pointer and constant variable?

1187


What is the difference between near, far and huge pointers?

1047


find out largest elemant of diagonalmatrix

2197


Explain continue keyword in c

983


write a c program for swapping two strings using pointer

2587


Explain what is the difference between functions getch() and getche()?

1004


Where does the name "C" come from, anyway?

1104


What are the similarities between c and c++?

1029


How can I send mail from within a c program?

1000


How can you be sure that a program follows the ANSI C standard?

1580


What is the difference between malloc() and calloc()?

1747


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1235