write a 'c' program to sum the number of integer values
Answer Posted / ruchi
#include<stdio.h>
#include<conio.h>
int main()
{
int n,m,m1,s=0,d,sum;
printf("\nEnter the number ");
scanf("%d",&n);
m=n%10;
d=n/10;
while(d>=10)
{
m1=d%10;
d=d/10;
s =s+m1;
}
sum=s+m+d;
printf("\nSum is %d",sum);
getch();
}
| Is This Answer Correct ? | 4 Yes | 15 No |
Post New Answer View All Answers
Explain how can you check to see whether a symbol is defined?
What is the process of writing the null pointer?
What is the argument of a function in c?
How does pointer work in c?
Define macros.
Why c is called free form language?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
What happens if a header file is included twice?
What are the two forms of #include directive?
What are the application of void data type in c?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
Explain output of printf("Hello World"-'A'+'B'); ?
What is a shell structure examples?
Is Exception handling possible in c language?
How the c program is executed?