if a five digit number is input through the keyboard, write
a program to calculate the sum of its digits.
(hint:-use the modulus operator.'%')
Answer Posted / rajrartan singh
#include<stdio.h>
#include<conio.h>
void main();
{
int n,d1,d2,d3,d4,d5,sum;
ptintf("enter the five digit no.");
scanf("d",&n);
s=d1+d2+d3+d4+d5;
getch();
}
| Is This Answer Correct ? | 4 Yes | 10 No |
Post New Answer View All Answers
What is the size of enum in c?
What is the use of getchar functions?
What is echo in c programming?
What are the advantages of external class?
Is c easy to learn?
When would you use a pointer to a function?
Explain which function in c can be used to append a string to another string?
What does c in a circle mean?
How can I pad a string to a known length?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
How does selection sort work in c?
What are the 5 types of organizational structures?
What is the use of pragma in embedded c?
What do header files do?
What is sorting in c plus plus?