Answer Posted / gg
try this....
#include<stdio.h>
int main()
{
int n,m,sum=0;
scanf("%d",&n);
for(m=0;((m=n%10)!=0);n=(n/10))
sum+=m;
printf("count is %d\n",sum);
}
Is This Answer Correct ? | 13 Yes | 16 No |
Post New Answer View All Answers
Create a simple code fragment that will swap the values of two variables num1 and num2.
How can I recover the file name given an open stream or file descriptor?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Which type of language is c?
praagnovation
What does the && operator do in a program code?
Differentiate between static and dynamic modeling.
What is the function of volatile in c language?
What is the purpose of type declarations?
What is the maximum length of an identifier?
What is NULL pointer?