using [include <iostream>]
i cannot make a Right Triangles Next to each other using asterisks.i want an output just like from below.please help me...
*.......................**********........**********......................*
**.....................*********............*********....................**
***...................********................********..................***
****.................*******....................*******................****
*****...............******........................******..............*****
******.............*****............................*****............******
*******...........****................................****..........*******
********.........***....................................***........********
*********.......**........................................**......*********
**********.....*............................................*....**********
MY syntax i was not able to make an output just like the above..without that dots.
#include<iostream>
using namespace std;
int main()
{
//First Triangle
for (int i = 0; i <= 10; i++) //this prints stars as rows
{
for (int j = 0; j < 10; j++) //this prints stars as columns
{
if (j == i)
{
cout << " *";
}
else
{
cout << " ";
}
}
cout << endl;
}
//Second triangle
for (int i = 0; i <= 10; i++) //this prints stars as rows
{
for (int j = 0; j < 1; j++) //this prints stars as columns
{
if (j == i)
{
cout << " ";
}
else
{
cout << "*";
}
}
}
//Third Triangle
for (int i = 0; i <= 10; i++) //this prints stars as rows
{
for (int j = 0; j < 1; j++) //this prints stars as columns
{
if (j == i)
{
cout << " ";
}
else
{
cout << "*";
}
}
}
//Fourth Triangle
for (int i = 0; i <= 10; i++) //this prints stars as rows
{
for (int j = 0; j < 1; j++) //this prints stars as columns
{
if (j == i)
{
cout << "*";
}
else
{
cout << " ";
}
}
}
system("pause");
return 1;
}
i dont know what to do .please help me..
Last edited on
@mj verdadero
Please run my code may be i solved your issue...
and please use code tags that will be more readable to people..