Showing posts with label Shapes in c. Show all posts
Showing posts with label Shapes in c. Show all posts

Tuesday 13 August 2013

Upper Triangle Numbered

Upper Triangle Numbered:

In this post of shapes in c language, you will find the code to draw upper 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 programming tools of C++ in drawing shapes in this programming language.
The codes we post are meant to:
  • Teach them the basic structure of C++ programming.
  • Help the visitors to understand the proper use of loops.
  • Helping them out for their projects and assignments.

Advantages of this code of shapes in c:

After studying this code you will be able to:
  • Use nested loops in your daily programming work.
  • master your self in using IF and ELSE conditions.
  • Make codes of different triangles of any desired size(// within the size limit of the console).
  • Draw complex shapes in c programming.


For more visit: draw triangle in c.


Code:


Your desired is showed below.
/* 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 length of the upper triangle\n";
    cin>>length;
for(int i=length, k=0; i>=0; i--, k++)
{
for(int j=0; j<length+k; j++)
{
if(j>i)
         cout << k;
else
         cout << " ";
}
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.


Output:








Upper-Triangle-Numbered-Shapes-In-C


Upper Triangle

Upper Triangle:

In this post of shapes in c language, you will find the code to draw upper 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 our visitors in drawing complex shapes.
  • Make them aware how to draw shapes using loops.
  • Helping them out for their different assignments.

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.
  • Make a generic codes to make triangles of any desired size(// within the size limit of the console).

For more visit: draw triangle 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 length=0;
cout << "Enter the length of the upper triangle\n";
cin>>length;
for(int i=length, k=0; i>=0; i--, k++)
{
for(int j=0; j<length+k; j++)
{
if(j>i)
          cout << "*";
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:




Upper-Triangle-Shapes-In-C

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

Lower Triangle

Lower Triangle:

In this post of shapes in c language, you will find the code to draw lower 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++ in drawing shapes in c programming language.
The codes we post are meant to:
  • Help our visitors to draw shapes.
  • Helping them out for their different assignments. 
  • Make them aware how to make easy 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.
  • Make a generic codes to make triangles of any desired size(// within the size limit of the console).
  • A clear cut help in designing similar problems.



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 triangle\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 << "*";
else
cout << " ";
}
cout<<endl;
  }
return 0;
}


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 to understand a problem 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 Parallelogram

Lower Parallelogram:

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

Purpose of this code of shapes in c:

In this post we have provided our visitors with a c++ sample program to draw complex shapes such a lower parallelogram. This code will draw a parallelogram specified size.
The codes we post are meant to:
  • Help our visitors to draw shapes.
  • Make them aware how to create shapes using loops in c programming language.
  • Helping them out for their different assignments.

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.
  • Make a generic codes to draw a numbered parallelogram of any desired size as well(// within the size limit of the console).
  • A clear cut help in designing similar program.

Code:

Copy the code from here.
/* Join 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 length of the lower parallelogram\n";
cin>>length;

 for(int i=0, k=0, l=3*length-3; i<length; i++, k++, l--)
 {
 for(int j=0; j<3*length; j++)
 {
 if(j>=k && j<=l)
  cout << "*";
 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 to understand a problem 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_Parallelogram_Shapes_In_c

Upper Parallelogram

Upper Parallelogram:

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

Purpose of this code of shapes in c:

In this post we have provided our visitors with a c++ sample program to draw complex shapes such a upper parallelogram. This code will draw a parallelogram specified size.
The codes we post are meant to:
  • Help our visitors to draw shapes.
  • Make them aware how to create shapes using loops in c programming language.
  • Helping them out for their different assignments.

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.
  • Make a generic codes to draw a numbered parallelogram of any desired size as well(// within the size limit of the console).
  • A clear cut help in designing similar program.

Code:

You can study your desired code from below.

/*   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 length of the upper parallelogram\n";
cin>>length;
for(int i=0, k=length, l=2*length-1; i<length; i++, k--, l++)
{
for(int j=0; j<3*length; j++)
{
if(j>=k && j<=l)
cout << "*";
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 to understand a problem 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:






Upper_Parallelogram_Shapes_In_C


Fan 2

Fan 2:

In this post of shapes in c you will be able to construct the code for a fan (Part 2) in C++ using "*".

Code:

/*              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;
cout<< "Enter the size of fan" << endl;
cin>>size;
for(int i=0 ; i<=size ; i++)
{
for(int j=0 ; j<i ; j++)
cout<<"  ";
for(int spaces=i ; spaces<=size ; spaces++)
{
if(i==0)
cout<<"* ";
else
if(spaces==i || spaces==size)
cout<<"* ";
else 
cout<<"  ";
}
for(int j=i ; j<size ; j++)
cout<<"  ";
for(int j=0; j<=i ; j++)
{
if(i==size)
cout<<"* ";
else 
if(j==0 || j==i)
cout<<"* ";
else 
cout<<"  ";
}
cout<<endl;
}
for(int m=0 ; m<=size ; m++)
{
for(int spaces1=m ; spaces1<=size ; spaces1++)
{
if (m==0)
cout<<"* ";
else
if(spaces1==m || spaces1==size)
cout<<"* ";
else
cout<<"  ";
}
for(int n=0; n<m ; n++)
cout<<"  ";
for(int spaces1=0 ; spaces1<=m ; spaces1++)
{
if(m==0 || m==size)
cout<<"* ";
else
if(spaces1==0 || spaces1==m)
cout<<"* ";
else 
cout<<"  ";
}
cout<<endl;
}
return 0;
}



Output:


Fan_In_Shapes_In_c