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
Where are some collections of useful code fragments and examples?
What is || operator and how does it function in a program?
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
Explain how do you determine the length of a string value that was stored in a variable?
Can a pointer be null?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
What are different storage class specifiers in c?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
Explain why C language is procedural?
how can I convert a string to a number?
How many levels of indirection in pointers can you have in a single declaration?
Explain pointer. What are function pointers in C?
What is a string?