try this
#include <iostream>
using namespace std;
int x;
int i;
int j;
void main(void)
{
cout << "Please input X";
cin >> x;
for(i=1;i<=x;i++)
{
for(j=1;j<=i;j++)
{
cout<<"*";
}
cout<<endl;
}
i--;
for(;i>0;i--)
{
for(j=1;j<i;j++)
{
cout<<"*";
}
cout<<endl;
}
}
It defaults to * but you could change it
just add the char in the declarations and replace * with the char
like this
#include <iostream>
using namespace std;
int x;
int i;
int j;
char cha;
void main(void)
{
cout << "\nPlease input X: \n";
cin >> x;
cout << "\nPlease input a character: \n";
cin >> cha;
for(i=1;i<=x;i++)
{
for(j=1;j<=i;j++)
{
cout << cha;
}
cout<<endl;
}
i--;
for(;i>0;i--)
{
for(j=1;j<i;j++)
{
cout << cha;
}
cout<<endl;
}
}
Just make it a little prettier and your set