For Loop: Definition, Example & Results


Choose an answer and hit 'next'. You will receive your score and answers at the end.

question 1 of 3

What is the initialization statement?

Create Your Account To Take This Quiz

As a member, you'll also get unlimited access to over 75,000 lessons in math, English, science, history, and more. Plus, get practice tests, quizzes, and personalized coaching to help you succeed.

Try it risk-free
Try it risk-free for 30 days. Cancel anytime.
Already registered? Log in here for access

1. How do you stop an infinite loop once it's occurred?

2. What does decrementing a loop involve?

Create your account to access this entire worksheet
A Premium account gives you access to all lesson, practice exams, quizzes & worksheets
Access to all video lessons
Quizzes, practice exams & worksheets
Certificate of Completion
Access to instructors
Create an account to get started Create Account

About This Quiz & Worksheet

In C programming, for loops are implemented in a variety of ways. This quiz/worksheet will assess what you know about these loops with questions on topics like a possible output (if any) of a code where the for statement's exit condition is always true and the output of a code where the loop iterates by 2.

Quiz & Worksheet Goals

The following points will be addressed:

  • Output (if any) of a code when the 'for loop' condition fails at the first iteration itself
  • Placement of a non-zero in condition place of a 'for loop'
  • Output in which the first line of a code ends in a semicolon

Skills Practiced

  • Information recall - access the knowledge you've gained regarding the potential outcome of a code in which the 'for loop' iterates by 2
  • Reading comprehension - make sure you understand the most important information about a code in which the for statement has an exit condition that's always true
  • Knowledge application - use your knowledge to answer questions about the output of a code in which the first line ends in a semicolon and a possible outcome of a code with a 'for loop' condition that fails at the first iteration of itself

Additional Learning

You can continue to learn more about the loop in the lesson called For Loop: Definition, Example & Results. These areas will be explored:

  • Explanation of a 'for loop' and when it's useful
  • Initialization statements
  • Test expression and update statements
  • 1st - 5th iterations of a code