Computer Science, asked by devaganapally29, 5 months ago

write a program in c language to print sum of number

Answers

Answered by evcho5640
2

Answer:

  1. int main() { int n, t, sum = 0, remainder;
  2. printf("Enter an integer\n"); scanf("%d", &n);
  3. t = n;
  4. while (t != 0) { remainder = t % 10; sum = sum + remainder; t = t / 10; }
  5. printf("Sum of digits of %d = %d\n", n, sum);
  6. return 0; }
Answered by MateenSAM
0
Search on YouTube you will find but tutorials for C language and other computer language
Similar questions