Program To Display The Sum Of The Individual Digits Of A Given Number
/* Program To Display The Sum Of The Individual Digits Of A Given Number */ #include
#include
void main() { int n,d=0,s=0; clrscr(); printf("\nEnter a number\n\n"); scanf("%d",&n); while(n>0) { d = n%10; s = s+d; n = n/10; } printf("\n sum of the individual digits = %d",s); getch(); }
Please send comments to
vgdarur.javafive@blogger.com
Copyright © 2008 - iForeRunner.com
http://www.iforerunner.com/