online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby, C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include<string.h> void reverse(char a[],int n){ int i=0,j=n-1; while(i<j){ char temp=a[i]; a[i]=a[j]; a[j]=temp; i++; j--; } } int main() { char x[100]; scanf("%s",x); int n= strlen(x); for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ if(i+j==n-1 && i==j){ reverse(x,n); } if(i==j){ printf("%c",x[i]); } else if(i+j==n-1){ printf("%c",x[j]); } else{ printf(" "); } } printf("\n"); } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue