Monday, October 21, 2013

I need to produce output like this. in first line there should be 1 esoteric (*), in 2nd line 3 esoteric (***), in 3rd line 5 esoteric (*****), in 4th line 7 esoteric (*******), and then decreasing to 5, 3 and 1 esoteric in c++.

i think you need output like this.
*
***
*****
*******
*****
***

*
here is its c++ code.

#include <iostream>
using namespace std;

void main()
{
int row,star,star2;
for(row=1;row<=7;row++)
{
    if(row<=4)
                {             
                for(star=1;star<=2*row-1;star++)
                   {
                      cout<<"*";
                   }
                }
   if(row>=5)
                {
           for(star2=1;star2<=15-2*row;star2++)
                 {
                   cout<<"*";
                  }
               }

 cout<<endl;

}
}

it is just easy to understand , i hope you will learn it.

3 comments:

  1. Wonderful work! That is the kind of information that
    should be shared around the net. Disgrace on the seek engines for no longer positioning this post higher!
    Come on over and discuss with my site . Thanks =)

    my blog: Star Wars Rebels Recon Cheats Tool

    ReplyDelete
  2. This is my first time pay a visit at here and i am truly pleassant to read all at alone place.



    Here is my web site ... free music downloads (http://freemusicdownloadsb.com/)

    ReplyDelete
  3. Nice blog here! Also your website so much
    up very fast! What web host are you using? Can I get your affiliate hyperlink on your host?
    I want my website loaded up as quickly as yours lol

    My weblog; super Battle Racers android cheats

    ReplyDelete