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, Java, PHP, Ruby, Perl, C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <math.h> int main() { const int numElements = 100; // this is the number of elements in the array float x[numElements]; // here we define 'x' which is an array of floats with size 'numElements' // here we count from 0 to 'numElements' for (int index = 0; index < numElements; index++) { float indexAsFloat = (float)index; // we need to convert it to a floating point type. float value = sqrtf(index); // find the square rooot of this index. x[index] = value; // the element of array x at this index is now set to value. } for (int i = 0; i < numElements; i++) { float value = x[i]; printf("Index: %u = %f\n", i, value); } 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.