Choose Category
#include <stdio.h> int main() { int no, sum = 0, remainder; printf("Enter an integer value\n"); scanf("%d",&n); while(no != 0) { remainder = no % 10; sum = sum + remainder; no = no/ 10; } printf("Sum of digits of given number = %d\n",sum); return 0; }