Program to find the sum of the digits of a number – Coding Question 9
Write a program to find the sum of the digits of a number. #include<stdio.h> int main() { int num,temp,sum=0,r; printf("n Enter a number: "); scanf("%d",&num); temp=num; while(num!=0) { r=num%10; sum+=r; num=num/10; } printf("n Sum of Digits of %d= %d",temp,sum); return 0; } Join Our Telegram Group Visit our Facebook Page Coding Questions Coding Question : […]
Program to find the sum of the digits of a number – Coding Question 9 Read More »