Sunday, June 12, 2016

Print Odd Numbers From 1 To 100 in C++

This simple program will display odd numbers from 1 to 100 the code is very simple and easy to understand using C++.


 Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Sample Program Output


Program Listing

odd.cpp


#include <iostream>
#include <stdlib.h>

using namespace std;

int main()
{
    cout << "Print Odd Numbers from 1 to 100";
    cout << "\n\n";
     for (int a=1; a<=100; a+=2) {
        cout << " " << a << " ";
     }
    cout << "\n\n";
    cout << "End of Program";
    cout << "\n\n";
    system("pause");
}

No comments:

Post a Comment