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 tell whether two strings are the same?
What is wrong with this declaration?
How can I find out if there are characters available for reading?
What is 'bus error'?
What are bitwise shift operators in c programming?
What is scanf_s in c?
What is p in text message?
Are comments included during the compilation stage and placed in the EXE file as well?
Write a code to remove duplicates in a string.
What does volatile do?
main() { printf("hello"); fork(); }
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
What is main return c?
write a program to print largest number of each row of a 2D array
Define circular linked list.