Add cin.get() or getch() before return 0; That way you wil need to hit a key before it closes.
Its meant to convert Celsius temp to Fahrenheit.....but I see it works It just closes really fast.#include <cstdlib>
#include <iostream>
using namespace std;
int main() {
double ctemp, ftemp;
cout << "Input a celsius temp and press ENTER: ";
cin >> ctemp;
ftemp = (ctemp * 1.8) + 32;
cout << "Fahrenheit temp is: " << ftemp;
return 0;
}
Add cin.get() or getch() before return 0; That way you wil need to hit a key before it closes.
Really popular one is system("pause");
There are five possible operations for any army. If you can fight, fight; if you cannot fight, defend; if you cannot defend, flee; if you cannot flee, surrender; if you cannot surrender, die." - Sima Yi
That didn't work and I had too add ";" b4 return or it would compile after i did what you said? .....mind post the code whole so I see if i am doing it right?
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower
IT WORKED ...thx guys