Sum digit from 1 to 10 for two way. 1. ( 1+10 ) * 10 / 2; 2. for( i = 1; i != 10; ++i )