C program to find the sum of digits of numbers until the resulting value is single digit number on October 28, 2012 Get link Facebook X Pinterest Email Other Apps #include<stdio.h> #include<conio.h> main() { int n,t,sum; int r; printf("Enter the numbers: "); scanf("%d",&n); t=n; while(t>9) { sum=0; do { r=t%10; sum=sum+r; t=t/10; } while(t!=0); t=sum; } printf("Final result is=%d",t); } Comments
Comments
Post a Comment