Loops

This is a discussion on Loops within the C++ Programming forums, part of the General Programming Boards category; I have a program like (thats an example) Code: #include <iostream> using namespace std; int main() { int x,y; cout<<"Insert ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220

    Loops

    I have a program like (thats an example)
    Code:
    #include <iostream>
    using namespace std;
    int main()
    {
    int x,y;
    cout<<"Insert a number\n";
    cin>> x;
    cin.ingore();
    cout<<"You have entered "<< x <<"\n";
    cout<<"What do you want to do 1.Go back\n2.Exit\n";
    if ( y == 1){
    ...... //what should i put here to execute a loop to the beggining?
    }
    if ( x == 2 ){
    ........//What should i put here to automaticaly exit the program?
    }
    cin.get();
    }
    Thank you!!!

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,810
    Woop?

  3. #3
    Registered User
    Join Date
    Oct 2005
    Location
    Brasil
    Posts
    220
    im sorry but i already read this but i could not find the solution :/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Too many loops D:
    By F5 Tornado in forum C++ Programming
    Replies: 6
    Last Post: 12-03-2007, 01:18 AM
  2. loops with incrementing strings .... ?
    By twomers in forum C++ Programming
    Replies: 1
    Last Post: 12-12-2005, 11:29 AM
  3. strings and loops...
    By twomers in forum C Programming
    Replies: 5
    Last Post: 12-12-2005, 11:28 AM
  4. help with arrays and loops
    By jdiazj1 in forum C Programming
    Replies: 4
    Last Post: 11-24-2001, 04:28 PM
  5. for loops - newbie q's
    By Narciss in forum C Programming
    Replies: 8
    Last Post: 09-26-2001, 03:44 AM

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