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

What are all different types of pointers in c?

1058


What does volatile do?

1039


When do we get logical errors?

1175


What is class and object in c?

1177


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

1255


Explain the red-black trees?

1202


What are valid signatures for the Main function?

1294


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

1171


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1106


Explain how can you avoid including a header more than once?

1147


What is openmp in c?

1068


What type of function is main ()?

1090


Why we use break in c?

1074


Describe how arrays can be passed to a user defined function

1345


Can a pointer be static?

1132