/* * File: main.cpp * Author: visitor */ #include using namespace std; /* * debuger = Απολαθοποιητής */ void simpleFor() { for (int i = 0; i < 10; i = i + 1) { cout << "int i equals to "; cout << i << endl; } } void forWithChar() { for (char c = 'a'; c <= 'z'; c++) cout << c << endl; } void simpleWhile() { int i = 9; char c = 'e'; while (i < 15 && c++ < 'g') cout << i++ << ' '; cout << endl; } void simpleDoWhile() { int i = 9; char c = 'e'; do { cout << i++ << " "; } while (i < 15 && c++ < 'g'); cout << endl; } void printAdress() { cout << "Jim Black" << endl; cout << "Saint George St 276" << endl; cout << "Norwich NQR 78" << endl; cout << "Great Britain" << endl; } void prtEvenNumbers() { for (int i = 0; i <= 100; i += 2) cout << i << " "; cout << endl; } void prt100x100() { for (int i = 0; i < 100; i++) { for (int j = 1; j <= 100; j++) cout << j << " "; cout << endl << endl; } } void prt100Adress() { for (int i = 0; i < 100; i++) { printAdress(); cout << endl; } } void breakAndContinue() { for (int i=0;; i++) { if (i==5) continue; else if (i>9) break; cout << i << " "; } } void simpleSelection() { int i = -5; if (i > 0) cout << "i is positive" << endl; else if (i == 0) cout << "i equals to zero" << endl; else cout << "i is negative" << endl; } int main(int argc, char** argv) { //simpleWhile(); //simpleDoWhile(); //prt100Adress(); //prtEvenNumbers(); //prt100x100(); //simpleSelection(); breakAndContinue(); return 0; }