infinite loop issues

I am not sure why this is stuck in the infinite loop, but I know that it is due to the last function. See below:

Here is my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <iostream>
using namespace std;

int main()    //start of main function

{
  
int percent; 			//input: discount percentage
float percentAsFraction,	//input: discount percentage conversion
listPrice,	               //input:  list price
salePrice,			//output: sale price
discount;			//output: savings

//Get the list price and discount percentage.
cout << "Enter item price and discount percentage:";
cin >> listPrice >> percent;

//Conversions and computations

percentAsFraction = percent / 100.00;
discount = listPrice * percentAsFraction;
salePrice = listPrice - discount;

//Display sale price and savings

cout << "The sale price is " << salePrice << " and the savings are " << discount <<  endl;

  return 0;  //Exit main function



}
Last edited on
Nevermind - I got it.
Topic archived. No new replies allowed.