My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Post hidden from Hashnode

Posts can be hidden from Hashnode network for various reasons. Contact the moderators for more details.

Surface of a cylinder- Površina valjka

Andrijana Bozovic's photo
Andrijana Bozovic
·Mar 13, 2022·

1 min read

A small school, very basic, project for calculating a surface of a cylinder using JavaScript, nothing major but am proud of myself. Wanted to write something.

​<!DOCTYPE html​> ​<​html​>

​<​head​> ​</​head​>

​<​body​> ​<​p​>​Izračunavanje površine valjka pomoću JavaScript-a​</​p​> ​ ​<​script​> ​ ​var​ ​r​ ​=​ ​5​; ​ ​var​ ​H​ ​=​ ​10​; ​ ​const​ ​Pi​ ​=​ ​3.14​; ​ ​var​ ​P​ ​=​ ​r​ ​​ ​r​ ​​ ​Pi​ ​*​ ​H​; ​ ​document​.​write​(​"Površina valjka je:"​,​ ​P​) ​ ​</​script​>

​</​body​>

​</​html​>

You can change the numbers of course in var r and var H, and instead of document.write u can use alert().