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
Is c language still used?
Explain how can I read and write comma-delimited text?
When should the volatile modifier be used?
Can static variables be declared in a header file?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
Can a file other than a .h file be included with #include?
Tell me when is a void pointer used?
Tell me about low level programming languages.
What is the best way to comment out a section of code that contains comments?
Write a program to show the change in position of a cursor using c
What is realloc in c?
How can I write a function that takes a format string and a variable number of arguments?
Differentiate between a for loop and a while loop? What are it uses?
How many types of errors are there in c language? Explain
What does %c mean in c?