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, COBOL, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ // Matrices /* Un programa que pida al usuario los datos de una matriz de 3×3, y muestre su determinante */ #include<iostream> #include<locale.h> #include<conio.h> int main(){ setlocale(LC_CTYPE, "Spanish"); int opt = 0; /*Variable opt(Sirve para volver al inicio del programa o salir).*/ double det = 0, det1 = 0, det2 = 0, rta = 0; /*Variables double: det(Determina la primera parte de la determinante), det1(Determina la segunda parte de la determinante), det2(Determina la tercer parte de la determinante)*/ double matriz[3][3] = {}; /*Variable double: matriz[3][3](Almancenará los datos de la matriz 3 x 3).*/ system("cls"); //Limpiará la pantalla al volver. //Texto introductivo std::cout<<"Ingrese los datos de su matriz 3 x 3"<<std::endl; std::cout<<std::endl; std::cout<<"|[0][0] [0][1] [0][2]|"<<std::endl; std::cout<<"|[1][0] [1][1] [1][2]|"<<std::endl; std::cout<<"|[2][0] [2][1] [2][2]|"<<std::endl; std::cout<<std::endl; for(int i = 0; i<=2; i++){ //Ciclo FOR para almacenar datos de la matriz. for(int j = 0; j<=2; j++){ std::cout<<"["<<i<<"] ["<<j<<"] = "; std::cin>>matriz[i][j]; } std::cout<<std::endl; } //Presentación de la matriz. std::cout<<"Matriz 3 x 3"<<std::endl; for(int i = 0; i<=2; i++){ std::cout<<" | "; for(int j = 0; j<=2; j++){ std::cout<<matriz[i][j]<<" | "; } std::cout<<std::endl; } //Determinante de la matriz. std::cout<<std::endl; det = (matriz[0][0])*(((matriz[1][1])*(matriz[2][2]))- ((matriz[1][2])*(matriz[2][1]))); det1 = (matriz[0][1])*(((matriz[1][0])*(matriz[2][2]))- ((matriz[1][2])*(matriz[2][0]))); det2 = (matriz[0][2])*(((matriz[1][0])*(matriz[2][1]))- ((matriz[1][1])*(matriz[2][0]))); rta = det - (det1) + (det2); std::cout<<"-La determinante de su matriz 3 x 3 es = "<<rta<<std::endl; //Opción para volver al programa o salir. do{ std::cout<<std::endl<<"Volver a ingresar matriz[1] // Salir del programa[2]"<<std::endl; std::cout<<"Opción = "; std::cin>>opt; if(opt == 1){ std::cout<<std::endl; return main(); } else if(opt > 2 || opt <= 0){//Si no se pone el 1 o el 2, saldrá mensaje de error. std::cout<<"-----ERROR: Solo puede elegir el 1 o el 2-----"<<std::endl; } else{ std::cout<<std::endl<<"Gracias por usar este programa :D"; getch(); return 0; } }while(opt>=3 || opt<=0); 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