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

Explain the advantages and disadvantages of macros.

1105


Is fortran still used today?

1100


What is a good way to implement complex numbers in c?

1055


Can you think of a logic behind the game minesweeper.

2470


What is main () in c language?

1135


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3318


Can we use any name in place of argv and argc as command line arguments?

1080


What is a const pointer?

1132


Disadvantages of C language.

1110


What is wrong in this statement?

1157


Subtract Two Number Without Using Subtraction Operator

858


What is the explanation for cyclic nature of data types in c?

1221


Explain what’s a signal? Explain what do I use signals for?

1169


What are the modifiers available in c programming language?

1227


What are the c keywords?

1207