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
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
What do you understand by friend-functions? How are they used?
What is difference between && and & in c?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
Give the rules for variable declaration?
What is sizeof int?
How do you search data in a data file using random access method?
What is a void pointer? When is a void pointer used?
What is this infamous null pointer, anyway?
What's a good way to check for "close enough" floating-point equality?
Compare interpreters and compilers.
How many keywords (reserve words) are in c?
What are all different types of pointers in c?
Explain null pointer.