<?php //PHP opening Tag
$odd_sequence= array(1,3,5,7,9,11); //This array contains six odd numbers
$even_sequence= array(2,4,6,8,10,12); // This array contains six even numbers
for($i=0; $i<=5;$i++)
{
$oe_sequence[$i]= $odd_sequence[$i]+$even_sequence[$i];// This statement //adds two arrays //and assigns in oe_sequence array
}
for($i=0;$i<=5;$i++)
{
echo "$oe_sequence[$i]\n"; //Prints $oe_sequence value
//here oe means odd even
}
?>
.......................................................................................
Program execution and and output you can see in the video.
Comments
Post a Comment