int sum=0;
for(;num>0;sum+=num%10,num/=10); // This is the "single line".
Saturday, December 5, 2009
Subscribe to:
Post Comments (Atom)
Data structures, Algorithms, Coding, Technical Interview Questions and much more. (Still work in progress)
0 comments:
Post a Comment