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 / sohini khan

main()
{int n,p,s=0;
while(n>0)
{
p=n%10;
s=s+p;
n=n/10;
}
printf("%d",s);
getch(),
}

Is This Answer Correct ?    29 Yes 43 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

code for replace tabs with equivalent number of blanks

2167


List the difference between a While & Do While loops?

1112


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

1098


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

2158


What are conditional operators in C?

1104


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

3179


What is wrong with this statement? Myname = 'robin';

1327


What is mean by data types in c?

1033


Why malloc is faster than calloc?

1070


What is spaghetti programming?

1143


can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1892


What is pointers in c?

1120


What is the significance of an algorithm to C programming?

1048


What is an endless loop?

1280


Explain how can you tell whether two strings are the same?

1020