Print number using for loop in C/C++