Author Question: What will the following code display?int x = 0;while (x < 5){ cout (Read 61 times)

Beheh

  • Hero Member
  • *****
  • Posts: 520
What will the following code display?
int x = 0;
while (x < 5)
{
    cout << x << " ";
    x++;
}

0 1 2 3 4
0 1 2 3 4 5
0
1
2
3
4

◦ This is an infinite loop


nanny

  • Sr. Member
  • ****
  • Posts: 313

Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
 

Did you know?

There used to be a metric calendar, as well as metric clocks. The metric calendar, or "French Republican Calendar" divided the year into 12 months, but each month was divided into three 10-day weeks. Each day had 10 decimal hours. Each hour had 100 decimal minutes. Due to lack of popularity, the metric clocks and calendars were ended in 1795, three years after they had been first marketed.

Did you know?

As many as 20% of Americans have been infected by the fungus known as Histoplasmosis. While most people are asymptomatic or only have slight symptoms, infection can progress to a rapid and potentially fatal superinfection.

Did you know?

Only 12 hours after an egg cell is fertilized by a sperm cell, the egg cell starts to divide. As it continues to divide, it moves along the fallopian tube toward the uterus at about 1 inch per day.

Did you know?

Elderly adults are at greatest risk of stroke and myocardial infarction and have the most to gain from prophylaxis. Patients ages 60 to 80 years with blood pressures above 160/90 mm Hg should benefit from antihypertensive treatment.

Did you know?

If you could remove all of your skin, it would weigh up to 5 pounds.

For a complete list of videos, visit our video library