Results 1 to 6 of 6

Thread: (solved) C++, dos?

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Kings's Avatar
    Join Date
    Aug 2001
    Posts
    673

    Question (solved) C++, dos?

    Hey

    I just started programming c++ and I have a very stupid question (I think)

    All my programs are dos, is this suppose to be in dos?

    I have this code and it opens a dos window,
    Code:
    #include <iostream.h>
    
    void odd (int a);
    void even (int a);
    
    int main ()
    {
      int i;
      do {
        cout << "Type a number: (0 to exit)";
        cin >> i;
        odd (i);
      } while (i!=0);
      return 0;
    }
    
    void odd (int a)
    {
      if ((a%2)!=0) cout << "Number is odd.\n";
      else even (a);
    }
    
    void even (int a)
    {
      if ((a%2)==0) cout << "Number is even.\n";
      else odd (a);
    }
    Any Idea? Thanks
    Last edited by Kings; Dec 1st, 2001 at 04:29 PM.
    K i n g s

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width