| 1 | |
| 2 | = Domače naloge = |
| 3 | Pravilnost vaših nalog lahko preverite z |
| 4 | [http://lecad.si/cgi-bin/cclass.cgi Ocenjevalcem nalog] |
| 5 | |
| 6 | == 1 == |
| 7 | |
| 8 | Napiši program ki izpiše ta trikotnik: |
| 9 | {{{ |
| 10 | * |
| 11 | ** |
| 12 | *** |
| 13 | **** |
| 14 | ***** |
| 15 | ****** |
| 16 | ******* |
| 17 | ******** |
| 18 | ********* |
| 19 | ********** |
| 20 | }}} |
| 21 | Ne uporabi desetih printf() ampak uporabi zanko. |
| 22 | {{{ |
| 23 | #!c |
| 24 | for(i = 0; i < 10; i = i + 1) |
| 25 | { |
| 26 | /* Več stavkov */ |
| 27 | /* gre lahko tukaj */ |
| 28 | } |
| 29 | }}} |
| 30 | |
| 31 | == 2 == |
| 32 | Izpiši v zanki cela števila od 1 do 10 in njihove kvadrate. |
| 33 | {{{ |
| 34 | 1 1 |
| 35 | 2 4 |
| 36 | 3 9 |
| 37 | ... |
| 38 | 10 100 |
| 39 | }}} |
| 40 | |
| 41 | {{{ |
| 42 | #!comment |
| 43 | http://www.eskimo.com/~scs/cclass/asgn.beg/PS1.html |
| 44 | }}} |