How would I nest a do...while loop in an if...else statement.

I'm trying to require the user to input a value of 5 or less. If not, then THIS takes place WHILE the var is > 5.

if (input > 5)
{
    do
    {

    }while(input >5);
}
else
//do something else

actually instead of this, you can simply use the while loop.. u dont need to nest do while inside if, unless i have not understood your question properly!

while(input > 5)
{
// do whatever you want to
};
e
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.