Interview Questions

Write a short code using C++ to print out all odd number from 1 to 100 using a for loop

C++ Interview Questions and Answers


(Continued from previous question...)

Write a short code using C++ to print out all odd number from 1 to 100 using a for loop

for( unsigned int i = 1; i < = 100; i++ )
if( i & 0x00000001 )
cout << i << \",\";

(Continued on next question...)

Other Interview Questions