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
What is the general form of #line preprocessor?
Once I have used freopen, how can I get the original stdout (or stdin) back?
Did c have any year 2000 problems?
What are c identifiers?
What is the c language function prototype?
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
any "C" function by default returns an a) int value b) float value c) char value d) a & b
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
What is the difference between if else and switchstatement
what are # pragma staments?
What are the two forms of #include directive?
What is getch?
What are control structures? What are the different types?
What are header files in c?
How would you obtain the current time and difference between two times?