Code:
<?php fwrite(STDOUT, "do you want ans in cel ? type y or N to continue \n"); //$handle = fread(STDIN, 80); $ansincel =fgets(STDIN); echo " Plz enter number \n"; //$handle1 = fread(STDIN, 80); $numdeg = fgets(STDIN); if ($ansincel = 'y') { $tc = ((5/9)*($numdeg - 32)); // convert to degrees celcius fwrite(STDOUT, " the degree in cel is $tc "); } else { $tf = ((9/5)*($numdeg + 32)); // convert to degrees fahrenheit fwrite(STDOUT, " the degree in far is $tf "); } ?>
Comment