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 string concatenation in c?
What does a function declared as pascal do differently?
What is the size of array float a(10)?
Describe explain how arrays can be passed to a user defined function
What are the different types of objects used in c?
What is the use of f in c?
Explain setjmp()?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What are pragmas and what are they good for?
What language is windows 1.0 written?
How to explain the final year project as a fresher please answer with sample project
What is selection sort in c?
swap 2 numbers without using third variable?
Explain the use of function toupper() with and example code?
When we use void main and int main?