Program to add digits of a number in C
#include <stdio.h> int main() { int n, sum = 0, remainder; printf(“Enter an integern”); scanf(“%d”,&n); while(n != 0) { remainder = n % 10; sum = sum + remainder; n … Read More
#include <stdio.h> int main() { int n, sum = 0, remainder; printf(“Enter an integern”); scanf(“%d”,&n); while(n != 0) { remainder = n % 10; sum = sum + remainder; n … Read More