Help

hello..
I have a problem, I bet with my friend to complete a program but so far I have not done, this example program ( http://www.mediafire.com/?12naykpi66fvkz6 )I do not know what should be typed. Thanks..
Sorry. Nobody will be "smart" enough to run your executable. If you want help, you must provide source code.
I'm sorry, this is not a virus, it's just a sample program, I just want to know the source code to create this program. I would insert his image. < http://tinypic.com/view.php?pic=168bwjb&s=5 >.

if I input the numbers even higher with the program it will be refused and asked to enter again, and input should be less than 10. output should be shaped like this (http://tinypic.com/view.php?pic=28useas&s=5 )

(http://tinypic.com/r/28useas/5 )
Last edited on
Again, very sorry. We normally don't do entire projects for people. For all we know this is a homework assignment for you to learn how to do this, and making it for you defeats that purpose.

As a general rule, never ask for full source code and always try to resolve yourself. If you get stuck, then post the piece of code where you are stuck and ask help for that specific problem.
oh ok, I recently completed the entry of choice, and I am still confused to get it done..

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

void main ()
{
int sisa, n, a, b;
Home:
clrscr();
cout<<"Input Numbers: ";
cin>>n;
sisa = n%2;
cout<<"\n";
if(sisa==0)
{
for (a = 1; a <= n; a++)
{
for (b = n; b >= a; b--)
{
cout<<" ";
}
for (b = 1; b <= a; b++)
{
cout<<"*";
}
for (b = (a-1); b >= 1; b--)
{
cout<<"*";
}
cout<<"\n";
}

for (a = 1; a <= n-1; a++)
{
for (b = 0; b <= a; b++)
{
cout<<" ";
}
for (b = 1; b <= (n-a); b++)
{
cout<<"*";
}
for (b = (n-a-1); b >= 1; b--) {
cout<<"*";
}
cout<<"\n";
}

}
else
goto Home;
}
Even i am confused .. what is going on .. and what you want .

I dont understand why second for loop .
I suppose this i will be the output.
  *
       **
     ***
    ****
   *****
  ******
 *******
*********
 *******
  ******
   *****
    ****
     ***
      **
       *
Last edited on
i want to make out put like this...( http://oi40.tinypic.com/28useas.jpg)

-------------------------------------------
-must be an odd number
- <10

input number : 9

*
222
*****
4444444
*********
6666666
*****
888
*

-=press any key =-


-----------------------------------------
thaks
Last edited on
Since I don't think there is a std::center for center alignment of output, you should create a function that returns a std::string that centers the text in the desired column width.

std::string CenterText(const std::string &input, int colWidth);

So you would build the individual strings inside a loop and then you would pass them on to CenterText() that will add the necessary number of spaces left and right to the input string and will return the input string padded with the spaces so it looks centered in the console.
i want to create my out put from:

http://oi39.tinypic.com/k1a0ig.jpg


to this:

http://oi39.tinypic.com/w9tzwm.jpg
Topic archived. No new replies allowed.