Which statement is used to skip the execution of the current iteration and start the next iteration in a loop?

Évaluation: JAMB UTME - Computer Studies - 2024 Matière: Computer Studies

Question 1 Rapport

Which statement is used to skip the execution of the current iteration and start the next iteration in a loop?
Détails de la réponse

The statement used to skip the execution of the current iteration and start the next iteration in a loop is the Continue statement.


In simple terms, when a loop is running, if the Continue statement is encountered, the following occurs:


  • The program stops executing the rest of the code inside the current iteration of the loop.
  • It immediately moves to the next iteration of the loop, bypassing any code that comes after the Continue statement in the current loop body.

This is particularly useful when certain conditions are met, and you want to skip over specific parts of the loop without terminating the entire loop. For example, if you are looping through numbers to find only even numbers, you might use the Continue statement to skip the code for odd numbers.

Téléchargez l'application sur Google Play.

Tout ce dont vous avez besoin pour exceller au JAMB, WAEC et NECO.

Green Bridge CBT Mobile App
Assistant de chat d'apprentissage personnalisé par IA
Plus de 200 000 questions d'examen IGCSE, JAMB, WAEC et NECO.
Plus de 1200 notes de cours
Assistance Hors Ligne - Apprenez à Tout Moment, Partout
Horaire du Pont Vert
Résumés littéraires et questions potentielles
Suivez vos performances et votre progression
Explications Approfondies pour un Apprentissage Complet