Computer Science, asked by pranjalsy, 1 year ago

WAP to enter 3 digits num and
print the of sum of its
individual Digit ( in C language)

Answers

Answered by Mehakjannat01
1

Answer: like that may be.

Explanation:

// C program to compute sum of digits in  

// number.  

# include<stdio.h>  

 

/* Function to get sum of digits */

int getSum(int n)  

{  

  int sum = 0;  

  while (n != 0)  

  {  

      sum = sum + n % 10;  

      n = n/10;  

  }  

  return sum;  

}

Similar questions