I'm not a super beginner at programming, but I am relatively new to compiling and running code through the windows command prompt window.
#include <stdio.h>
int main(){
double LATER = 0, EARLIER = 0, RESULT = 0; // Declare and initialize LATER and EARLIER
//to store operands and RESULT to hold a
//calculated result. Declare as type double.
char COMMAND = ' '; // Declare COMMAND to store the last entered character.
return 0;}
/*
while !(COMMAND == 'q')
{
printf("Please enter operand(s), and/or an operator. \n (For division and subtraction, ensure that the numerator or minuend is entered first): \n");
scanf("%lf %lf %c \n",&EARLIER,&LATER,&OPERATOR); // Read in large float values for EARLIER and LATER and a character value for OPERAND
printf("= %.3lf", RESULT);
}
*/
Whenever I compile this (GCC) and try to run it, my command prompt freezes -- that is, it accepts no input and just lingers around as a black screen (with prior console output still displayed). Anyone have any idea what I should do to fix this?
Update: Tried to run the same thing from CodeBlocks and had the same problem. Two console windows popped up, one ran the code and closed, the other stuck around and won't close. Still cannot run the program again without a restart.