I am a beginner and i am typing in some simple program code and most of my programs are running but close immediately. I am using Dev-C++, Here is some code maybe someone can school me a bit??? Code: #include <stdio.h> int radius, area; int main(void) { printf( "Enter radius (i.e. 10): " ); scanf( "%d", &radius ); area = (int) (3.14159 * radius * radius); printf( "\n\nArea = %d\n", area ); getchar(); return 0; }
Open a console window (cmd) and run the program. If you are a beginner use Turbo C - it's a free download and easy to install and use - it was the number 1 compiler for Ms-Dos. And, dont have any apprehensions about using Turbo C just because ms-dos is obsolete - you will find it's still the best way to learn C!