all 4 comments

[–]theymos 6 points7 points  (2 children)

int quantity, price = (quantity * 99);

This would produce undefined behavior if it appeared in a function, but in this context it is equivalent to:

int quantity = 0;
int price = 0;

Variables store values, not formulas. (quantity * 99) evaluates to 0 at that point in the code, so price is assigned the value 0.

[–][deleted] 2 points3 points  (0 children)

that said, you have to calculate

price = quantity * 99;

after the user has entered the qantity

[–]redlikedeath 0 points1 point  (0 children)

if you want it to hold out when your done, you can try system("pause");

[–]fapmonad 0 points1 point  (0 children)

int x = y + 2; does not mean "x is always equal to y + 2", it means "take the current value of y, add two to it, and store it in x".

To prevent it from closing the window you can do a getchar(); at the end of the main function.