Answer Posted / rakesh ranjan
#include<conio.h>
#include<stdio.h>
main()
{
int x=0,n,i;
printf("entre the number");
scanf("%d",&n);
for(;n>0;n/=10)
x=x+n%10;
printf("sum = %d",x);
getch();
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
How do I determine whether a character is numeric, alphabetic, and so on?
Array is an lvalue or not?
Explain about the functions strcat() and strcmp()?
What does d mean?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
What is non linear data structure in c?
Why should I use standard library functions instead of writing my own?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
What are the disadvantages of a shell structure?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
How to draw the flowchart for structure programs?
What is a pointer variable in c language?
Describe dynamic data structure in c programming language?
What are the advantages and disadvantages of a heap?