We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Sum of Digits of a Five Digit Number
Sum of Digits of a Five Digit Number
Sort by
recency
|
728 Discussions
|
Please Login in order to post a comment
I know it is ugly but it is my logic :D
include
include
include
include
int main() {
}
int main (){
}
include
int main(){ int n,sum=0; scanf("%d",&n); while(n>0){ sum=sum+n%10; n=n/10;} printf("%d",sum); return 0;}