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

16y 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.


Example program arrays in turbo c plus plus?

Yes, you can use for-loop in a C program compiled by Turbo C.