CPP/Loops/For

From ProgrammingExamples
< CPP
Revision as of 21:55, 29 June 2010 by FirstPerson (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#include <iostream>
using namespace std;
 
int main(){
 
 for(int i = 1; i <= 100; i++ ){
    if(i % 2 == 0) cout << i << " is even\n";
    else cout << i << " is odd\n";
 }
 
 return 0;
}