Tuesday, 13 August 2013

Lower Triangle Numbered

Lower Triangle Numbered:

In this post of shapes in c language, you will find the code to draw lower numbered triangle in C++ using "*". 

Purpose of this code of shapes in c:

The main purpose of this code is to help our visitors to understand how, to use simple programming tools of C++ to create shapes in c programming language.
The codes we post are meant to: 
  • Help them out in their different c programming assignments.
  • Help our visitors in drawing complex shapes.
  • Make them aware how to draw shapes using loops.

Benefits from this code of shapes in c:

There are many benefits of this code for our visitors.After studying this code you will be able to carry out the following benefits:
  • Easily understand the use of nested loops.
  • Appropriate use of If Else conditions.
  • You will be able to make  generic codes to  triangles of any desired size(// within the size limit of the console).


For more visit: draw triangle 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";
 cout<<"CAUTION:   The input should not be other than numerical values \n\n\a";
int length=0;
cout << "Enter the size of the lower trianlge\n";
cin>>length;
for(int i=0, k=length; i<length; i++, k--)
{
for(int j=0; j<length+k; j++)
{
if(i<j)
cout << k;
     else
cout << " ";
}
cout<<endl;
}
}

Note:

Shapes in c is basically a forum for the programmers , who visit it and find the proper solution for their problems.The codes we post here are meant to help out our visitors in understanding different problems and not for using in final submissions of assignments.We will not take any responsibility for any sort of plagiarism case if you copy pasted our code in your final assignments.




Output:



Lower_Triangle_Numbered_Shapes_In_c

0 comments:

Post a Comment