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
how do you execute a c program in unix.
What is strcmp in c?
Give the rules for variable declaration?
What is a stream?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
how to construct a simulator keeping the logical boolean gates in c
What does volatile do?
Can we declare variable anywhere in c?
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
Explain the priority queues?
There seem to be a few missing operators ..
What is include directive in c?
Why is event driven programming or procedural programming, better within specific scenario?
What is a void pointer? When is a void pointer used?
If errno contains a nonzero number, is there an error?