Answer Posted / guest
#include<stdio.h>
int main()
{
int n,sum=0;
printf("enter number");
scanf("%d".&n);
for(int i=0;i<5;i++)
{
sum=sum+(n%10);
n=n/10;
}
printf("sum is %d",sum);
return 0;
}
| Is This Answer Correct ? | 16 Yes | 2 No |
Post New Answer View All Answers
Is malloc memset faster than calloc?
What is action and transformation in spark?
What are dangling pointers? How are dangling pointers different from memory leaks?
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
What does c in a circle mean?
What is file in c preprocessor?
What is meant by initialization and how we initialize a variable?
What are the features of c language?
How can I get random integers in a certain range?
Create a simple code fragment that will swap the values of two variables num1 and num2.
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
What is the difference between struct and union in C?
What is %d called in c?
What is the use of #define preprocessor in c?
How many levels deep can include files be nested?