I am trying to code hollow diamond pattern but it is giving aborting command wall time warning and not showing output.
However, when i run same code on vs code, there is no problem. Would you explain me the reason and also send me the optimised code for it.
Hollow diamond
Hi! To find out what I can do, say @discobot display help
.
#include using namespace std; int main() { unsigned int n; cin>>n; int row, col,i=0; for(row=1;row<2n;row=row+1){ for(col=1;col<2n;col=col+1){ if(col<=n-i||col>=n+i){ cout<<’*’; } else{ cout<<’ '; } } if(row<n){ i=i+1; } else{ i=i-1; } cout<<endl; } cout<<endl; return 0; }
Please suggest some optimisation to this code
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
sir when i clicked on share option i didn’t get the url please tell me how can i send you a pdf file
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
sir when i clicked on share option i didn’t get the url please tell me how can i send you a pdf file
Hi! To find out what I can do, say @discobot display help
.
Hi! To find out what I can do, say @discobot display help
.