i've been doing this code since yesterday.
#include <iostream>
using namespace std;
int main()
{
int X=1;
do{
int Y=0;
do{
cout<<" ";
Y++;}
while(Y<=5-X||Y<=X-5);
int Z=1;
do{
cout<<"*";
Z++;}
while(Z<=X&&Z<=10-X);
cout<<endl;
X++;}
while(X<=9);
}
THE OUTPUT IS A HALF DIAMOND, BUT IM HAVING DIFFICULTY REMOVING THE SPACE IN THE EDGE, IT SHOULDN'T HAVE A SPACE. THANKS
Last edited on
Line 9: if( Y != 0 ) cout<<" ";
but we are not allowed to use other than do while