Skip to main content

Posts

Showing posts with the label c plus plus coding

Program to print odd numbers from 100 to 1 in C++

In a C++ program, you can write code to print odd numbers from 100 to 1. Here is how to do it.  C++ Program Code #include <iostream.h> int main () { for (int i=99 ; i > 0 ; i-- ) if (i % 2) std::cout << i << ' ' ; return 0 ;  } The output of the Program