Re: [Dev-C++] Having trouble with Dev-C++ compiler
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: jose i. c. <ji...@ci...> - 2005-02-28 00:54:05
|
Perhaps,
system("PAUSE");
will help.
On 18:48 Sun 27 Feb , Ken Meisner wrote:
>
>
>
> Ken Meisner
> bic...@ea...
> Why Wait? Move to EarthLink.
>
>
> When i execute a program using Dev-C++ the program will not show the end result after entering input; it will just exit the display screen. Why does this happen?
>
> Take this program for example.....
>
>
> /*
> Find the number of gallons held in a cylindrical tank.
> top down design
>
> I. Get input from the user
> A. Establish the diameter of the tank in feet
> B. Establish the height of the liquid in the tank in feet
>
> II. Calculate the volume of a cylinder in cubic units
> A. Compute the diameter and height values in the formula for volume
> of a cylinder
> B. Volume of a cylinder is 3.1416*radius*radius*h
> C. Radius is the diameter/2
> D. The obtained volume is then converted to gallons
>
> III. Display the results
> A. Display the volume
> B. Format: The volume of the given diameter and height:
> "_' "_' etc. "is" the volume */
>
> #include<iostream.h>
>
> int main()
>
> {
>
> float height, diameter, volume, gallons;
>
> cout << " Enter the diameter and the height of the cylinder " << endl;
> cin >> diameter >> height;
> volume = 3.1416 * (diameter/2) * (diameter/2) * height;
> gallons = volume * 7.5;
> cout << " The Volume of the given diameter and height is " << endl;
> cout << diameter << height << volume;
>
> return 0;
>
> }
>
>
> .......after i enter the diameter and height it will exit the screen instead of showing the answer. My program works with the compiler at school but not with this one. Thanks for any help you can give me.
|