online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <math.h> using namespace std; /// delkaracja funkcji//////////////////////////////////////////////////////////////////// void rozwiazrownanie(float a, float b, float c); void wczytajDane(float &a, float &b, float &c); /// głowna funkcja program//////////////////////////////////////////////////////////////////// int main() { float a ,b, c;///<- Zminne lokalne/////////////////////////////////////////// cout<<"Program oblicza trójman kwadratowy a * x^2 + b * x + c"; // Tekst wyświetlany na konsoli. wczytajDane(a, b, c);///wywołanie funkcji///////////////////////// rozwiazrownanie(a, b, c);///wywołanie funkcji///////////////////////// //system("pause"); cin.get();///zatrzymanie programu, czyli funkcji main///////////////////////// return 0; } /// definicja funkcji;//////////////////////////////////////////////////////////////////// void wczytajDane(float &a, float &b, float &c){ cout<<"\n Podaj a "; cout<<endl; // Przejście kursora do nowej linii. cin>>a; // Przypisane podanej wartości do zmiennej "a". cout<<"Podaj b "; cout<<endl; cin>>b; cout<<"Podaj c "; cout<<endl; cin>>c; } void rozwiazrownanie(float a, float b, float c){ float delta, x1, x2; if(a==0) { cout<<"To nie jest r\242wnanie kwadratowe "; cout<<endl; } else { delta=(b*b)-(4*a*c); // Wyznaczenie delty cout<<"delta = " <<delta; cout<<endl; if (delta<0) { cout<<"R\242wnanie nie ma pierwiastk\242w x1 i x2"; cout<<endl; } else if (abs(delta)<0.0000001) { x1=-b/(2*a); cout<<"x1 = " <<x1; cout<<endl; } else { x1=(-b-sqrt(delta))/(2*a); x2=(-b+sqrt(delta))/(2*a); cout<<"xl="<<x1<<"\tx2="<<x2; cout<<endl; } } }

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