Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Voor Lus | Introductie tot Programmastroom
C++ Introductie
course content

Cursusinhoud

C++ Introductie

C++ Introductie

1. Aan de Slag
2. Inleiding tot Operatoren
3. Variabelen en Gegevenstypen
4. Introductie tot Programmastroom
5. Introductie tot Functies

book
Voor Lus

De for-lus is complexer dan de andere lussen en bestaat uit drie delen. Structuur van de for-lus:

python
  • Teller;

  • Eindvoorwaarde;

  • Lusuitdrukking.

cpp

main

copy
123456789
#include <iostream> int main() { for (int counter = 0; counter <= 5; counter++) { std::cout << counter << std::endl; } }
  • int counter = 0: iteratie teller;

  • counter++: Voor elke iteratie wordt 1 toegevoegd aan de counter variabele om de doorgang van de lus te markeren;

  • counter <= 5: lus beëindigingsvoorwaarde. De lus gaat door als de counter variabele kleiner dan of gelijk aan 5 is.

question mark

Hoeveel iteraties zal deze lus maken?

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 4. Hoofdstuk 5

Vraag AI

expand
ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

course content

Cursusinhoud

C++ Introductie

C++ Introductie

1. Aan de Slag
2. Inleiding tot Operatoren
3. Variabelen en Gegevenstypen
4. Introductie tot Programmastroom
5. Introductie tot Functies

book
Voor Lus

De for-lus is complexer dan de andere lussen en bestaat uit drie delen. Structuur van de for-lus:

python
  • Teller;

  • Eindvoorwaarde;

  • Lusuitdrukking.

cpp

main

copy
123456789
#include <iostream> int main() { for (int counter = 0; counter <= 5; counter++) { std::cout << counter << std::endl; } }
  • int counter = 0: iteratie teller;

  • counter++: Voor elke iteratie wordt 1 toegevoegd aan de counter variabele om de doorgang van de lus te markeren;

  • counter <= 5: lus beëindigingsvoorwaarde. De lus gaat door als de counter variabele kleiner dan of gelijk aan 5 is.

question mark

Hoeveel iteraties zal deze lus maken?

Select the correct answer

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 4. Hoofdstuk 5
Onze excuses dat er iets mis is gegaan. Wat is er gebeurd?
some-alt