हिंदी
तमिलनाडु बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान कक्षा १२

Explain the if elseif else statement. With suitable example. - Computer Applications

Advertisements
Advertisements

प्रश्न

Explain the if elseif else statement. With suitable example.

संक्षेप में उत्तर

उत्तर

  1. If-elseif-else statement is a combination of if-else statement.
  2. More than one statement can execute the condition based on user needs.

Syntax:

if (1st condition)
{
Execute statement(s) if condition is true;
}
elseif(2nd condition)
{
Execute statement(s) if 2ndcondition is true;
}
else
{
Execute statement(s) if both conditions are false;
}

Example Program:

<?php
$Pass_Mark=35;
$first_class=60;
$Student_Mark=70;
if ($Student_Mark>= $first_class){ echo “The Student is eligible for the promotion with First Class”;
}
elseif ($Student_Mark>= $Pass_Mark){ echo “The Student is eligible for the promotion”;
}
else {
echo “The Student is not eligible for the promotion”;
}?>
shaalaa.com
If elseif else Statement in PHP
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: PHP Conditional Statements - Evaluation - PART – IV [पृष्ठ १११]

APPEARS IN

सामाचीर कलवी Computer Applications [English] Class 12 TN Board
अध्याय 6 PHP Conditional Statements
Evaluation - PART – IV | Q 4. | पृष्ठ १११
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×