Right Angled Triangle in C++ 4:
In this post of shapes in c language, you will find the code for constructing a bottom right corner right angled triangle in C++ using "*".
For more visit: triangle programs in c.
Purpose of this code of shapes in c:
The
basic purpose of this code is to help our visitors to understand the use of
simple programming tools of C++ to draw a constructive program.
This code has been posted to:
This code has been posted to:
- Help our visitors to draw complex shapes.
- Make them aware of the use of simple loops to create shapes.
- Helping them in designing different triangles easily.
- Helping them out for their different assignments.
Advantages of this code of shapes in c:
After studying this code you will be able to:
- A clear cut help in designing similar problems.
- Easily understand the use of nested loops.
- Make a generic code that will be able to make a triangle of any desired size(// within the size limit of the console).
- Appropriate use of If Else conditions.
For more visit: triangle programs in c.
Code:
Your desired code is as follows:
/* 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";
cout<<"CAUTION: The input should not be other than numerical values \n\n\a";
int size=0;
cout << "Enter the size of the right angle triangle\n";
cin>>size;
for(int i=size; i>=0; i--)
{
for(int j=0; j<size; j++)
{
if(j<i)
cout << " ";elsecout << "*";}cout<<endl;}}
Disclaimer:
These
codes are meant to help you out in designing similar problems as discussed here and
provide you with a sense how to deal with such problems.Shapes in c will not take any responsibility for any sort of plagiarism case if you copy pasted our code in your final assignments.