Answer Posted / ruchi
#include<stdio.h>
#include<conio.h>
int main()
{
int n,m,d,m1,s=0,s1;
printf("enter the number ");
scanf("%d",&n);
m=n%10;
d=n/10;
while(d>=10)
{
m1=d%10;
d=d/10;
s=s+m1;
}
s1=s+m+d;
printf("\nThe sum of digits is ");
printf("%d",s1);
getch();
}
| Is This Answer Correct ? | 7 Yes | 11 No |
Post New Answer View All Answers
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What are the storage classes in C?
What is the difference between functions abs() and fabs()?
What is quick sort in c?
What is C language ?
Who is the founder of c language?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
When should we use pointers in a c program?
How can I get back to the interactive keyboard if stdin is redirected?
What is a protocol in c?
What is union in c?
What is cohesion and coupling in c?
What is the c language function prototype?
What is class and object in c?
What is an endless loop?