C++ Programming Question:
Download Questions PDF

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

C++ Programming Interview Question
C++ Programming Interview Question

Answer:

for( unsigned int i = 1; i < = 100; i++ )

if( i & 0x00000001 )

cout << i << ",";

Download C++ Programming Interview Questions And Answers PDF

Previous QuestionNext Question
Write a program that ask for user input from 5 to 9 then calculate the averageWhat is public, protected, private in C++?