1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Beginner needs help with closing programs please.

Discussion in 'C' started by basic25, Feb 11, 2011.

  1. basic25

    basic25 New Member

    Joined:
    Feb 11, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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;
    }
     
  2. eriyer

    eriyer New Member

    Joined:
    Jan 22, 2011
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    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!
     

Share This Page