Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

C%20%20%20Interview%20Questions%20and%20Answers

Question: Write a short code using C++ to print out all odd number from 1 to 100 using a for loop
Answer:
for( unsigned int i = 1; i < = 100; i++ )
if( i & 0x00000001 )
cout << i << ",";
 
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook