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 use of sizeof?
in linking some of os executables are linking name some of them
Where static variables are stored in c?
What is a far pointer in c?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
Should I learn c before c++?
What is the easiest sorting method to use?
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
Which is more efficient, a switch statement or an if else chain?
How do we print only part of a string in c?
What is difference between stdio h and conio h?
Can the size of an array be declared at runtime?
Explain pointers in c programming?
regarding pointers concept
Write a program on swapping (100, 50)