Skip to content

Instantly share code, notes, and snippets.


StaniTr/Circle Area

Created Jul 14, 2014
What would you like to do?
//function calcSircleArea(r) - func with parameter r (radius)
function calcCircleArea(r){
var area=Math.PI*r*r;
return area;
//console.log(arguments); --prints arguments of the function
function printArea(){
document.getElementById('print').innerHTML='r = 7 area= '+calcCircleArea(7)+'</br>'+ 'r= 1.5 area ='+calcCircleArea(1.5)+'</br>'+ 'r= 20 area ='+calcCircleArea(20);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment