Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I write the following if statement in C? 1

Status
Not open for further replies.

Rmcta

Technical User
Nov 1, 2002
478
US
I need to say:

if x number is between a and b
and y number is between c and d
Then . . .

I tried the following but does not work:
if( (4>=12) && (4<=20) && (16>=15) && (5 <=11) )
do this
else
do that
 
Seems good to me - with appropriate substitutions for x,y,a,b,c,d


--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top