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 / rama krishna sidhartha

int n = 1234; //any numer of you want sum
int sum = 0;
void main()
{
clrscr();
while (n > 0)
{
int p = n % 10;
sum = sum + p;
n = n / 10;
}
printf("%d",sum);
getch();
}

Is This Answer Correct ?    49 Yes 75 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1692


What is the argument of a function in c?

991


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2307


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

2048


List the different types of c tokens?

1010


What is the purpose of main() function?

1184


Wt are the Buses in C Language

3152


Apart from dennis ritchie who the other person who contributed in design of c language.

1321


What is void pointers in c?

958


Where can I get an ansi-compatible lint?

1100


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1186


What is union and structure?

1040


What are the main characteristics of c language describe the structure of ac program?

1149


string reverse using recursion

2373


Is null always equal to 0(zero)?

990