ok i need to write something like

if 
{
    days > 5 && minutes > 5
}

basically i need minutes to be around 5 to 10, and cannot be greater than 10. how do i do write this within the same if statement?

Recommended Answers

All 4 Replies

Member Avatar for coil

if(minutes>5 && minutes<10) should do the trick. If you need 5-10 inclusive, use >= and <=

thanks, but i also need the days in the if statement with the minutes. it is already in a nested if statement.

Member Avatar for coil

It's basically the same thing, only you replace 'minutes' with 'days'.

In general, you can use && (and) and || (or) to append as many conditions as you want.

oh crap nevermind, it was a typing error all along!! and i thought that i couldn't put 3 conditions in the statement... -_-

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.