Celcius to fahrenheit

i am very new to c++ programming and i have a homework tomorrow pls help me on this one.

i have to make a program that convert celcius to fahrenheit. i can see it is working but after i type in some number, it doesnt show the result but it just closes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//this program converts celcius temperature to fahrenheit temperature
#include <iostream>
using namespace std;
int main()
{
  double
  celcius,
  fahrenheit;
  
  cout << "Enter the Celcius Temperature" << endl;
  cin  >> celcius;
  
  fahrenheit=9/5*celcius+32;
  
  cout << "Fahrenheir= " << fahrenheit << endl;
  cin.get();
  return 0;
  
}
Last edited on
Use

cin.ignore();

before cin.get();
Just add another cin.get(); before the return 0; statement.
tyvm madguy!!
@MarkJason

the two suggestions will work!!!
Topic archived. No new replies allowed.