hi
i write this code but i phase a problem :::
her the code
Code:#include<iostream.h> #include<conio.h> int main() { int i,j,k,l=1,num; cout<<"Enter the no:"<<endl; cin>>num; for(k=num;k>=1;k--) { for(i=k;i>=1;i--) cout<<" "; if(l<num) { for(j=1;j<=l;j++) cout<<"*"<<" "; } l++; cout<<endl; } for(k=num; k>=1; k--) { for(j=1; j<=l; j++) { cout<<" "; } if( l <= num) { for(i=k; i>=1; i--) cout << "*" << " "; } l++; cout<<endl; } getch(); return 0; }
the out Put is
Code:* * * * * * * * * * * * * * * * * * * * * * * * * * * *
the Output Should be
Code:* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
where is the problem ....Please Help
Re grads




Reply With Quote