Answer Posted / pooja
main()
{
int n,i,sum=0,r;
printf("enter the value");
scanf("%d",&n);
while(n!=0)
{
r=n%10;
n=n/10;
sum=sum+r;
}
printf("\nsum of digits is %d",sum);
}
Is This Answer Correct ? | 57 Yes | 11 No |
Post New Answer View All Answers
What are the features of c languages?
can anyone please tell about the nested interrupts?
please explain every phase in the "SDLC" in the dotnet.
Explain how many levels deep can include files be nested?
What is the difference between int main and void main in c?
Can a local variable be volatile in c?
What is the purpose of sprintf?
How can you call a function, given its name as a string?
What is far pointer in c?
Is javascript based on c?
how do you execute a c program in unix.
What is the advantage of an array over individual variables?
Write a program to swap two numbers without using a temporary variable?
Define Spanning-Tree Protocol (STP)
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none