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
What is define directive?
What is data structure in c language?
All technical questions
What is a char in c?
What is a macro?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
Explain that why C is procedural?
What are the advantage of c language?
Difference between strcpy() and memcpy() function?
Find MAXIMUM of three distinct integers using a single C statement
Explain how does free() know explain how much memory to release?
What are types of structure?
Who is the main contributor in designing the c language after dennis ritchie?
What is floating point constants?
What is the correct declaration of main?