Quiz on Repetition with Loops

Test your knowledge of repetition with loops.

1

What is the result when the following program is executed?

#include <iostream>
using namespace std;

int main() 
{
  for (int c = 0 ; c < 3 ; c++)
  {
    cout << c << " ";
  }
  return 0;
}
A)

1 2 3

B)

0 1 2

C)

3 2 1

D)

3

Question 1 of 60 attempted

Get hands-on with 1200+ tech skills courses.