C++ Syntax Question: Download Questions PDF
Write a short code using C++ to print out all odd number from 1 to 100 using a for loop?
![Basic C++ Syntax Interview Answer Basic C++ Syntax Interview Question](https://globalguideline.com/public/images/interview/4.png)
Answer:
for( unsigned int i = 1; i < = 100; i++ )
if( i & 0x00000001 )
cout << i << ",";
if( i & 0x00000001 )
cout << i << ",";
Download Basic C++ Syntax Interview Questions And Answers
PDF