-->





Translate

C++ SHAPES CODES

9 comments
C++ SHAPES:
CODE SHAPES USING NESTED FOR  “*”. 
*
**
***
****
*****
CODE


#include<iostream.h>
#include<conio.h>

void main()

{

   clrscr();

   for(int i=1; i<=5; i++)

   {

      for(int j=1; j<=i; j++)

      {

cout<<"*";

      }

cout<<endl<<endl;

  }

   getch();

}


C++ SHAPES:
CODE SHAPE USING NESTED FOR  “*”. 

*****
****
***
**
*

#include<iostream.h>
#include<conio.h>

void main()

{

   clrscr();

   for(int i=5; i>=1; i--)

   {

      for(int j=1; j<=i; j++)

      {

cout<<"*" ;

      }

cout<<endl<<endl;

   }

   getch();

}



C++ SHAPES:
CODE SHAPES USING NESTED FOR  “*”. 



           *
      **
    ***
  ****
*****


#include<iostream.h>

#include<conio.h>

void main()

{

   clrscr();

   for(int i=1; i<=5; i++)

   {

      for(int k=5; k>i;  k--)

      {

      cout<<" ";

      }

      for(int j=1; j<=i; j++)

      {

cout<<"*";

      }

cout<<endl<<endl;

   }

   getch();

}


C++ SHAPES:
CODE SHAPES USING NESTED FOR  “*”. 

 *****

   ****
     ***
       **
         *

#include<iostream.h>

#include<conio.h>

void main()

{

   clrscr();

   for(int i=5; i>=1; i--)

   {

      for(int k=5; k>i;  k--)

      {

         cout<<" ";

       }

      for(int j=1; j<=i; j++)

      {

cout<<"*";

      }

cout<<endl;

   }

   getch();

}



CODE SHAPES USING NESTED FOR  “*”. 


1*****
12****
123***
1234**
12345*
123456



#include<iostream.h>

#include<conio.h>

void main()

{

   clrscr();

   for(int i=1; i<=6; i++)

   {

      for(int k=1,a=1; k<=i; k++)

      {

       cout<<a; a++;

      }

      for(int j=5; j>=i; j--)

      {

cout<<"*";

      }

cout<<endl<<endl;

   }

   getch();

}


9 comments:

  1. Nice job bro!! keep it up!! it helped me a lot!

    ReplyDelete
  2. How to do the parallelogram shape?

    ReplyDelete
  3. *
    **
    ***
    ****
    ***
    **
    *
    i want code for this above pattern

    ReplyDelete
    Replies
    1. #include
      #include
      using namespace std;

      int main()
      {
      for(int a=1;a<=10;a++)
      {
      if(a<=5)
      {

      for(int a1=1;a1<=a;a1++)
      {
      cout<<"*";
      }
      }
      else{
      for(int b=10;b>a;b--)
      {
      cout<<"*";
      }
      }
      cout<<endl;
      }
      }


      Thanks For Visiting

      Delete
  4. how to make this pattern?

    1
    * 1
    3 * 1
    * 3 * 1
    5 * 3 * 1
    5 * 3 * 1
    * 3 * 1
    3 * 1
    * 1
    1

    ReplyDelete
  5. how to make asterisk pattern of heptagon. thanks in advance. really needed
    it

    ReplyDelete
  6. I want a pattern of A hollow triangle please every urgent.....

    ReplyDelete
    Replies
    1. Its Here..
      http://fahad-cprogramming.blogspot.com/2014/02/hollow-triangle-shape-in-c-programing.html

      Delete
  7. i want a pattern that make number 1 using *

    ReplyDelete