You are on page 1of 1

#include "stdafx.

h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int num ; cout << "Input the range upto which you want to print: " ; cin >> num ; cout << "Odd Numbers are: " ; for(int i=1 ; i<=num ; i=i+2) { cout << i << "," ; } cout << endl ; cout << "Even Numbers are: " ; for(int j=0 ; j<=num ; j=j+2) { cout << j << "," ; } cout << endl ; return 0; }

You might also like