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

If null and 0 are equivalent as null pointer constants, which should I use?

1143


What is use of bit field?

1249


What is a node in c?

934


Is main an identifier in c?

1099


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16620


What is the meaning of && in c?

974


Differentiate fundamental data types and derived data types in C.

997


What are the standard predefined macros?

1087


Can you apply link and association interchangeably?

1083


Why c is called free form language?

985


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1034


What are static variables in c?

1038


Is this program statement valid? INT = 10.50;

1096


What is the size of array float a(10)?

1105


What are the valid places to have keyword “break”?

1054