Day 69: Simple Mathematics of 100DaysCodingChallenge
Hello all,
#day69
Day69
Today's my task was to Write a Program to Print Radius, Diameter, Circumference and Area of a Circle based on the Radius of a Circle taken by the user input Using Function.
I have started the 100 days of coding challenge to improve my programming skills..
Code :
let r = prompt("Enter a Radius of a Circle : ");
function circle(r) {
  let pi = 3.14;
  let d = 2 * r;
  let c = 2 * pi * r;
  let a = pi * r * r;
  console.log(`The Radius of a Circle is ${r}`);
  console.log(`The Diameter of a Circle is ${d}`);
  console.log(`The Circumference of a Circle is \n${c}`);
  console.log(`The Area of a Circle is ${a}`);
}
circle(r); 
Output :
Happy Coding:)
Thank you...

 
 
 
Comments
Post a Comment