Tuesday, 13 August 2013

Right Angle Triangle 1

Right Angled Triangle in C++ 1:

In this post of shapes in c, you will find the code for constructing a top left right angled triangle in C++ using "*". 

For more visit: triangle programs in c.

Code:


Copy the code from here.
/*        Join us at
 http://shapesinc.blogspot.com    for more codes of shapes */
#include<iostream>
using namespace std;
int main()
{
cout << "Join http://shapesinc.blogspot.com for more codes of shapes\n\n";
int size=0;
cout << "Enter the size of the right angle triangle\n";
cin>>size;
for(int i=0; i<size; i++)
{
for(int j=i; j<size; j++)
cout << "*";
cout << endl;
}
}



Output:





Right_Angle_Triangle_Shapes_In_C


0 comments:

Post a Comment