+ 2
How can write program to print this figure by using loop
12345 678 910 11
6 Answers
+ 2
cout << "12345\n";
cout << "678\n";
cout << "910\n";
cout << "11\n";
+ 2
by using loop
+ 2
what mean of true
+ 2
int i;
for(i=1;i<=11;i++)
{
if(i==6)
{
cout>>"\n";
}
if(i==9)
{
cout>>"\n";
}
if(i==11)
{
cout>>"\n";
}
cout<<i;
}
+ 2
while (true)
{
cout << "12345\n";
cout << "678\n";
cout << "910\n";
cout << "11\n";
}
Edit: true means an infinite loop in this program. This is a valid program that will cause an infinite loop.
+ 1
do{cout<<"12345\n678\n910\n11";}while(false);