Chapter 5 Quiz Starting Out With C++ 012

Which of the following is an example of an infinite loop

a.
x=1;
while (x>=1)
   cout << "I'm in a loop";
b.
while infinite ()
   cout << "I'm in a loop";
c.
while ()
{
   cout << "I'm in a loop";
}

d.
x=10;
while (x >0)
{
   x--;
   cout << "I'm in a loop";
}


1 comment:

  1. a.
    x=1;
    while (x>=1)
    cout << "I'm in a loop";

    ReplyDelete