answersLogoWhite

0

for (int x = 0; x < 5; x++)
{
cout << "The number is " << x << endl ;
}

Prints 0 - 4 (looping 5 total times)

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Example of flowchart of while loop in c plus plus?

kk


What is CPU usage small programm c plus plus?

Example: int main (void) { LOOP: goto LOOP; }


How do you alternate the input numbers using for loop in c plus plus?

Input a variable.


How do you convert meters to centimeters in c plus plus using the for loop construct?

It is unnecessary to use a for loop to convert meters to centimeters. Just multiply by 0.01.


How do you write a C plus plus program that displays a pyramid of Xes on the screen using a for loop?

printf ("x")


Does 'for loop' works in C plus plus?

In C++, a for loop is structured as follows: for( int index = 0; index &lt; 10; ++i ) { //do something }


What is an infinite loop in c plus plus?

An infinite loop is one sequence of commands that just repeats over and over again forever. When it comes to creating an infinite loop you can use the: for do while and do statements. using the keywords 'true'


How do you display stars in c plus plus using the if else structure and a for loop and you use void main?

It depends on what program you design really


Is for loop is faster than while loop in turbo c plus plus compiler?

No, why did you think so?


Making multiplication table in c plus plus using do while loop?

Um, not sure how to do that, but you can create a sort of "table" in C++ by using multidimensional arrays. Below is an example of how to create a two-dimensional array: int myArray[10] [10]; You can add more dimensions to the array in order to increase its storage capacity.


What is the definition of 'nested' in C programming?

In C a structure within a structure is called nested. For example, you can embed a while loop in another while loop or for loop in a for loop or an if statement in another if statement.


C plus plus what do you do if im stuck in an infinite loop?

There are three ways out of a loop.1. Satisfy the loop ending condition2. Execute a break statement3. Terminate the programPerhaps you are not changing the value of the variable that is used in the loop ending condition. Perhaps you are using a variable, such as an unsigned int, decrementing it, and expecting it to go negative. Suggest you run the program in a debuger and step through the loop.