This function is different than those we've seen before as it returns an answer. Ignore that for now. We'll talk about functions in the next chapter.


<body>
<script language="JavaScript">
    function convertC2F (tempInC) {
        return 9/5*tempInC + 32;
    }
    document.write('<h3>Fig 20-1: Convert a couple of temperatures from F to C</h3>');
    for(cnt=0; cnt<=100;cnt=cnt+5)
       document.write('<br>' + cnt + 'C is ' + convertC2F(cnt) + 'F');
</script>
</body>