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#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include <stdlib.h> char printMainMenu(){ char input=' '; printf("\n\n\t\tGas Laws Calculator\n\n"); printf("\t\tMENU\n"); printf("\n\t\t(A) Avogadro's Law\n"); printf("\t\t(I) Ideal Gas Law\n"); printf("\t\t(C) Combined Gas Law\n"); printf("\t\t(Q) Quit\n"); printf("\n\t\tEnter your choice: "); scanf(" %c",&input); return input; } // int menuAvogardo(){ int AvoCal=0; printf("\nAvogadro's Law\n"); printf("Please select what you want to calculate.\n"); printf("\n(1) Find Volume (V1)\n"); printf("(2) Find Volume (V2)\n"); printf("(3) Find Moles (n1)\n"); printf("(4) Find Moles (n2)\n"); printf("(5) Quit\n"); printf("\nEnter your choice: "); scanf("%d",&AvoCal); return AvoCal; } // void findVolume(){ } // void findMoles(){ } int main() { char input; int i, AvoCal, IdealCal, ComCal; double n, P, V, T, V1, V2, n1, n2, P1, P2, T1, T2; const float R=0.0821; while(1) { input = printMainMenu(); // break; // Solutions switch(input) { case 'A': { AvoCal=menuAvogardo(); switch(AvoCal){ case 1: { printf("\nFind V1\n"); printf("Enter given values.\n"); printf("Value of V2: "); scanf("%lf", &V2); printf("Value of n2: "); scanf("%lf", &n2); printf("Value of n1: "); scanf("%lf", &n1); V1=(n1*V2)/n2; printf("\nAnswer: V1= %.2lf", V1); } break; case 2: { printf("\nFind V2\n"); printf("Enter given values.\n"); printf("Value of n2: "); scanf("%lf", &n2); printf("Value of V1: "); scanf("%lf", &V1); printf("Value of n1: "); scanf("%lf", &n1); V2=(n2*V1)/n1; printf("\nAnswer: V2= %.2lf", V2); }break; case 3: { printf("\nFind n1\n"); printf("Enter given values.\n"); printf("Value of n2: "); scanf("%lf", &n2); printf("Value of V1: "); scanf("%lf", &V1); printf("Value of V2: "); scanf("%lf", &V2); n1=(n2*V1)/V2; printf("\nAnswer: n1= %.2lf", n1); }break; case 4: { printf("\nFind n2\n"); printf("Enter given values.\n"); printf("Value of n1: "); scanf("%lf", &n1); printf("Value of V2: "); scanf("%lf", &V2); printf("Value of V1: "); scanf("%lf", &V1); n2=(n1*V2)/V1; printf("\nAnswer: n2= %.2lf", n2); }break; case 5: exit (0); } } break; case 'I': break; case 'C': break; case 'Q': default: exit(0); break; } } }

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