#include<iostream>
#include<random>
void recursive (int i)
{
if (i!=0) recursive (i-1);
std::cout << i << ' ';
}
int main()
{
std::cout << "Recursive loop\n\n";
recursive (10);
std::cout << "\n\nProcedural goto loop\n\n";
int w=0;
again:
std::cout << w << ' ';
if (w++!=10) goto again;
std::cout << "\n\nFor loop\n\n";
for (int x=0; x!=10; x++)
std::cout << x << ' ';
std::cout << "\n\nWhile loop\n\n";
int y=0;
while (y++!=10)
std::cout << y << ' ';
std::cout << "\n\nDo-while loop\n\n";
int z=0;
do
{
std::cout << z << ' ';
} while (z++!=10);
std::cout << '\n' << std::endl;
}
Its limited only by available memory.
how do we use loops in c plus plus programing and what are basic differences between do,for and while loop
how to write a program that counts automorphic number from 1 to 999
By learning how to program on C+.
Don't write, it is already written, google for 'cpp'.
Divide it by 1000.
No.
You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.
there is no solution of this problem...........that's it..........
printf ("x")
Write your program and if you are having a problem post it here with a description of the problem you are having. What you are asking is for someone to do your homework for you.
int x= 1; int y= 2;