a questionare!

This is a discussion on a questionare! within the C++ Programming forums, part of the General Programming Boards category; actually i had to make a questionare in c++. i wanted that if the user doesnt select the answer option ...

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    4

    Post a questionare!

    actually i had to make a questionare in c++.
    i wanted that if the user doesnt select the answer option from option a,b,c or d then it should again ask the same question.
    so i wanted to ask that if there is any command to that will repeat the same set of statements.
    it would be nice if you can give an easy code.
    thanks in advance!

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,820
    A loop?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Apr 2010
    Posts
    4

    Smile confusion!

    actually ma'am u r right. i think a loop would do. But i dont know actually to run a loop with given set of statements untill the condition is over. plzz help me with this. thanks in advance!

  4. #4
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    Well, you can always loop indefinitely and break out of it if it reached a certain parameter like so:

    Code:
    while (true)
    {
           if (foo == true)
                   break;
    }
    Not a good way to do it IMHO, but it's doable.
    ERROR: Brain not found. Please insert a new brain!

    “Do nothing which is of no use.” - Miyamoto Musashi.

Popular pages Recent additions subscribe to a feed

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