c++ help

csbrox

Member
Sep 20, 2008
14
0
0
hope thsi is working for u

#include <iostream.h>

int main()
{
int i, j, k, space, n=5;
for (i=1; i<=n; i++)
{
for (j=1; j<=n-i; j++)
cout<<" ";
for (j=1,k=2*i-1; j<=2*i-1; j++,k--)
{
if (j <= k)
cout<<j;
else
cout<<k;
}
cout<<"\n";
}

return 0;
}

//remove using part and replace iostream with iostream.h if u using turbo c++