write a program to sum of its digit with using control
structure or with out using loop. for ex: let the number is
25634 then answer will be=2+5+6+3+4=20
Answer Posted / thiruapthi rao
// mainlogic
while(number>0)
{
remainder=number%10;
sum=sum+remainder;
number=number/10;
}
/*
number=123
sum=1+2+3=6
*/
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How many types of sorting are there in c?
What is the difference between test design and test case design?
Explain modulus operator.
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
What is string function c?
Why do we use static in c?
How do you view the path?
In C, What is the #line used for?
What are operators in c?
What are the types of bitwise operator?
Write a C program linear.c that creates a sequence of
processes with a given length. By
sequence it is meant that each created process has exactly
one child.
Let's look at some example outputs for the program.
Here the entire process sequence consists of process 18181:
Sara@dell:~/OSSS$ ./linear 1
Creating process sequence of length 1.
18181 begins the sequence.
An example for a sequence of length three:
Sara@dell:~/OSSS$ ./linear 3
Creating process sequence of length 3.
18233 begins the sequence.
18234 is child of 18233
18235 is child of 18234
........ this is coad .... BUt i could not compleate it .....:(
#include
Write a program to print ASCII code for a given digit.
What is the difference between array and pointer?
Why void main is used in c?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above