How do I get my dos window to stay open so that I can view the results for more than a second?
-
// homework5.cpp // By Catherine Bellamy #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; double Product(double, double); double Quotient(double, double); int main() { double num1, num2; //Prompt user for numbers. cout << "Enter the first number: "; cin >> num1; cout << endl; cout << "Enter the second number: "; cin >> num2; cout << endl; return 0; } //Call Product(). double Product(double num1, double num2) { double product; product = num1 * num2; cout << "Product is " << product << endl; return product; } //Call Quotient(). double Quotient(double num1,double num2) { double quotient; if (num2 == 0) cout << "Dividing by 0 is not allowed!"; else quotient = num1/num2; cout << "Quotient is " << quotient << endl; cin.get(); return quotient; } This is the code I have so far. It will build and debug but the window will not stay open long enough for me to see the results. Please Help!
-
Answer:
Another way would be to right click on the file, select Properties, and select the "Program" tab and uncheck the "close on exit" box. NOTE: not all files have this option so you'll just have to see if your program does
Rinie at Yahoo! Answers Visit the source
Other answers
before running this, open a command prompt start/run/ type ''cmd'' w/o the quotes this will open a dos window then you can see results
Related Q & A:
- How do i get rid of a second icon?Best solution by Ask.Metafilter.Com
- How do I get a job in IT or Software Development if I have no experience and only a 3rd class degree?Best solution by answers.yahoo.com
- How do I get my 2006 Suzuki Grand Vitara open?Best solution by answers.yahoo.com
- Whenever I get a runny nose, I bleed from my nose. How can I stop this?Best solution by healthtap.com
- How do I change .3gp video files to other video files, so I can open it up in Windows?Best solution by helpdeskgeek.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.