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
Can the “if” function be used in comparing strings?
write a program to copy the string using switch case?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
What are the advantages and disadvantages of c language?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is the difference between text and binary i/o?
What is the need of structure in c?
What do you mean by command line argument?
What math functions are available for integers? For floating point?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
How can I read/write structures from/to data files?
what is the difference between 123 and 0123 in c?