HOW I WRITE A CODE IN CODEBLOCKS PLATFORM IN ORDER NOT TO GET ANY TYPE OF ERROR

Hey sir please solved my problem everytime i code it runs smoothly on my ide but whenever it write code on codeblocks platform it always show test cases failed and wrong answer and then i feel demotivated i am attaching my code of the above problem
#include
using namespace std;
int main() {
int n , m;
cin >> n >> m;
int a[n][m];
for(int i=0 ; i<n ; i++){
for(int j=0 ; j<m ; j++){
cin >> a[i][j];
}
}
int startRow=0;
int endRow=n-1;
int startCol=0;
int endCol=m-1;
for(int i=startCol ; i<=endCol ; i++){
if(i%2==0){
for(int j=startRow ; j<=endRow; j++){
cout << a[j][i] << " ,";
}
}else{
for(int j=endRow ; j>=startRow ; j–){
cout << a[j][i] << " ,";
}
}
}
cout << " END";
return 0;
}
tell me how i write code in order to not to get ant type error please solve my problem it demotivates me

hello @aasif2364

pls save ur code at cb ide and share its link with me.

just keep practicing bugs in code will reduce with time

i don’t know how to share cb ide

go to this link -> https://ide.codingblocks.com/

paste ur code in editor ,press ctrl +s and then save

a url will be generated in ur search bar copy that link and paste it here

check now-

Now it is running finely
Thank YOu :slight_smile:

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.