online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <stdio.h> #include <stdlib.h> #define gran 0.3f int main(void) { float tab[5] = { 2.5, 2.6, 3.4, 3.7, 5}; float a; printf("POdaj element: "); scanf("%f", &a); a = a * 10; int granC = gran * 10; for (int i = 0; i < 5; i++) { int f = (int) abs(tab[i] * 10 - a); if (f <= granC) { printf("Element %f na pozycji %d pasuje \n", tab[i], i); } else { printf("Element %f na pozycji %d nie pasuje \n", tab[i], i); } } }

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