Friday, February 8, 2013

Week-3: 3.2 : IF else

 If else:

Instead of using two IF Statements, you can use an IF … ELSE Statement instead. Here's
the structure of an IF … ELSE statement:

if ( condition_to_test ) {

else {


The first line starts with if, followed by the condition you want to test for. This goes
between two round brackets. Again, curly brackets are used to section off the different
choices. The second choice goes after the word else and between its own curly brackets.
Here's our code again that checks a user's age:

Visit for Details

No comments:

Post a Comment