Connecting Tech Pros Worldwide Forums | Help | Site Map

Similarities and differencest between control structures

Newbie
 
Join Date: Jan 2008
Location: General Santos City
Posts: 2
#1: Jan 28 '08
Hi! I just wanted to ask about the similarities and differences between if statement & switch statement?? Thanks

Newbie
 
Join Date: Jan 2008
Posts: 1
#2: Jan 28 '08

re: Similarities and differencest between control structures


Quote:

Originally Posted by artsaulon

Hi! I just wanted to ask about the similarities and differences between if statement & switch statement?? Thanks

hello I will tell u if statement checks the condition then exitcute the if block if condition is true other wise it exicute else block while the switch statement directly jump to the given case and exicute the statement.
Moderator
 
Join Date: Mar 2007
Location: North Bend Washington USA
Posts: 5,382
#3: Jan 28 '08

re: Similarities and differencest between control structures


A switch is equivalent tro nested if/else statements.
Reply