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...

Program to find the sum of digits of a given number until
the sum becomes a single digit

Answer Posted / somasundaram

#include<stdio.h>
#include<conio.h>
void main()
{
unsigned int no;
clrscr();

printf("Enter number : ");
scanf("%d", &no);

if(no==0)
printf("sum = 0");
else
{
no=no%9;
if(no==0)
printf("sum = 9");
else
printf("sum = %d", no);
}

getch();
}

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is better oop or procedural?

988


What is the difference between fread and fwrite function?

1033


Explain what are the advantages and disadvantages of a heap?

1032


an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational

1259


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

985


How can I prevent another program from modifying part of a file that I am modifying?

1010


Explain what is the most efficient way to store flag values?

1173


Function calling procedures? and their differences? Why should one go for Call by Reference?

1041


What is function in c with example?

1088


What is void pointers in c?

958


In C language, a variable name cannot contain?

1222


Write a program to implement queue.

1066


Why is c called a mid-level programming language?

1153


How is a structure member accessed?

1060


When should you use a type cast?

1057