[Help]Ugh...Thought I had it working!!!

Posts 1–4 of 4 · Page 1 of 1
[Help]Ugh...Thought I had it working!!!
Hey guys,

I'm having a problem...I just finished compiling a code through Dev-C++, and every time I run it, I never see the results. The program shuts of too quickly. Since I'm new to coding, is there a way I can have the program stay open longer than 1/1000 of a second? Here's the code if it'll help...By the way, I'm just learning so this is a code from a book.

Code:
/*
  Project 1-1
  
  This program converts feet to meters.
  
  Call this program FtoM.cpp
*/

#include <iostream>
using namespace std;

int main()
{
    double f; // holds the length in feet
    double m; // holds the length in meters
    
    cout << "Enter the length in feet: ";
    cin >> f; // read the number of feet
    
    m = f / 3.28; // convert to meters
    cout << f << " feet is " << m << " meters.";
    
    return 0;
}
Added code tags for ya, let's use em when we can

Several ways to.

1.[php]cin.get(); //put before return 0[/php]
2.[php]system("pause"); //put before return 0[/php]
Lol, I looked all over for the tags sorry. / Thanks Kallisti I'll try it!
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags

None

Talk with us