Celsius to Fahrenheit
PHP
Easy
4 views
Problem Description
Input is a temperature in Celsius. Print Fahrenheit with 2 decimals.
Input Format
One number c.
Output Format
One number f (2 decimals).
Official Solution
<?php
$inputText=trim(stream_get_contents(STDIN));
if($inputText==='') exit;
$c=floatval($inputText);
$f=$c*9/5+32;
echo number_format($f,2,'.','');
?>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!