Answer Posted / anil kumar nahak
void main()
{
int n,i,sum=0,r;
printf("enter the value");
scanf("%d",&n);
while(n>0)
{
rem=num%10;
sum=sum+rem;
num=num/10;
}
printf("sum = %d",sum);
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
Explain 'bus error'?
How can you access memory located at a certain address?
Are the variables argc and argv are local to main?
When can you use a pointer with a function?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
When should I declare a function?
What is the difference between functions abs() and fabs()?
What is an auto variable in c?
Should I learn c before c++?
Can you please explain the difference between malloc() and calloc() function?
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
which is conditional construct a) if statement b) switch statement c) while/for d) goto
What is c programming structure?
What is the difference between union and structure in c?