Triangle Program in C++

Hello Everybody!
I need to make 2 triangles and their shape should be :
//1st Triangle
*****
****
***
**
*

//2nd Triangle
*****
..****
....***
......**
........*

//Nevermind those dots...



I am done coding the first triangle but my problem is the second one. I need to make it using only 2 Loops (Nested Loops)
Below is my Code for the First One :
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream.h>
#include <conio.h>
main()
{
      int x,y;
      for (x=5;x>=1;x--){
          for (y=1;y<=x;y++){
              cout<<"*";
              }
              cout<<endl;
              }
      getch();
}

Can you help me for the other one? Thank you in Advance =)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream.h>
#include <conio.h>
main()
{
      for (int x=0;x<5;x++)
     {
          for (int y=0;y<5;y++)
         {
              if (y<x)
              {
                     cout<<" ";
              }
              else
               {
                    cout << "*";
               }
         }
         cout<<endl;
     }            
      getch();
}

Hope this helps
Topic archived. No new replies allowed.