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
Describe the steps to insert data into a singly linked list.
What happens if you free a pointer twice?
How does normalization of huge pointer works?
How to declare pointer variables?
What are c preprocessors?
Explain high-order bytes.
What is nested structure with example?
what are the different storage classes in c?
Linked lists -- can you tell me how to check whether a linked list is circular?
Why do we write return 0 in c?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
Why is c called a mid-level programming language?
What is pointer to pointer in c with example?
What are static variables in c?
Why shouldn’t I start variable names with underscores?