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

Is main is a keyword in c?

1123


how to construct a simulator keeping the logical boolean gates in c

2251


What is the difference between text files and binary files?

1346


What header files do I need in order to define the standard library functions I use?

1051


Explain the difference between null pointer and void pointer.

1078


Explain null pointer.

1107


Explain enumerated types in c language?

1046


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

2363


What is else if ladder?

1019


How can I split up a string into whitespace-separated fields?

1053


Differentiate between Macro and ordinary definition.

1377


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1636


What is const keyword in c?

1159


What is adt in c programming?

1156


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

5463