half diamond using for loop






#include<iostream>
#include<conio.h>
using namespace std;
main()
{
int x,y,z;
for (x=1;x<=5;x++)
{
for (y=x;y<=4;y++)
{
cout<<" ";
}
for (z=1;z<(2*x);z++)
{
cout<<"*";
}
cout<<endl;
}
return 0;
}