Program problem

This is a discussion on Program problem within the C++ Programming forums, part of the General Programming Boards category; When I finish my program right after the funtion is excuted it always seems to end instantly. Can anyone help....

  1. #1
    Unregistered
    Guest

    Program problem

    When I finish my program right after the funtion is excuted it always seems to end instantly.

    Can anyone help.

  2. #2
    Unregistered (a different one)
    Guest
    not if you dont post any code!

  3. #3
    Unregistered
    Guest

    stupid me

    here

    //Practice Program//
    #include <iostream.h>
    int main()
    {
    int x; //number entered is x//
    cout<<"Please type a number greater than 5 but less than 10: ";
    cin>>x; //include x//
    if(x>5||x<10) //if statment//
    {
    cout<<"This is a number between 5 and 10: "; //if number entered 5-10//
    }
    else if(x<5||x>10)
    {
    cout<<"This number is not between 5 and 10: "; //if not entered 5-10//
    }
    return 0;
    }

  4. #4
    Unregistered
    Guest
    Could you show me? I really dont get where to put it i keep gettin errors

  5. #5
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    523
    Code:
    getchar(); // press enter to continue
    return 0;
    simple
    All spelling mistakes, syntatical errors and stupid comments are intentional.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multi Thread Program Problem
    By ZNez in forum C Programming
    Replies: 1
    Last Post: 01-03-2009, 11:10 AM
  2. Program Termination Problem
    By dacbo in forum C Programming
    Replies: 3
    Last Post: 01-23-2006, 02:34 AM
  3. Inheritance and Dynamic Memory Program Problem
    By goron350 in forum C++ Programming
    Replies: 1
    Last Post: 07-02-2005, 03:38 PM
  4. Replies: 20
    Last Post: 06-13-2005, 12:53 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21