Hi there! The following tutorial will introduce you to one of the most common problems encountered in programming subjects. Later on, I will provide set of activities and quizzes for you to practice on to improve your programming skills.
A temperature converter is just one of the exercises given by most programming instructors. Some other exercises are the following:
- Identify if odd or even number
- Display numbers using a for loop
- Solve for the area of a triangle
- Fibonacci Series
and many more. These are just some of the activities that I posted here in my blog. You can visit the links if you want.
Visit my post about Celsius to Fahrenheit in Java here.
Formula Celsius and Fahrenheit Converter
C x 9/5 + 32 = F
(F - 32) x 5/9 = C
First, we will convert Celcius to Fahrenheit. Let's try to convert 32 degrees Celsius to degrees Fahrenheit.
PHP Code Celsius and Fahrenheit Converter
Celsius to Fahrenheit
<?php
$c=32;
$f=$c*9/5+32;
echo $f."F";
?>
Fahrenheit to Celsius
<?php
$f=89.6;
$c=($f-32)*5/9;
echo $c."C";
?>
No comments:
Post a Comment