JavaScript Program for Data Types

Full Stack Web Development Courses with Real-time projects Start Now!!

Program 1

//console.log(10+20)   // addition  30
// console.log("10"+20)   // concat 

// console.log(50-10)   // 40
// console.log("50"-"10"+20)  // 60 
// console.log("50"*"10")  // 500
// console.log("50"/10)  // 5
// console.log("Vivek"*"Rahul")  // NAN   alphabet string
// let a=null
// console.log(typeof(a))
// let b
// console.log(typeof(b))

// +  - *  / 

// a=50
// b=10
// c=a+b
// console.log("Addition is: "+c)
// c=a-b
// console.log("Sub is: "+c)
// c=a*b
// console.log("Multiplication is: "+c)
// c=a/b
// console.log("Division is: "+c)

// Swaping of two values
// a=100
// b=50
// console.log("Before swaping " +a + " " + b)
// c=a     
// a=b
// b=c
// console.log("After swaping " +a + " " + b)

// a=100
// b=50
// console.log("Before swaping " +a + " " + b)
//    a=a+b      // a=150
//    b=a-b       // b=100
//    a=a-b       // a=50 
// console.log("After swaping " +a + " " + b)

// area of cricle  
  let r=12.34
  const PI=3.14
  let A
  A=PI*r*r
  console.log("area is "+A)
  let c
  c=2*PI*r
  console.log("circumference is:  "+c)

 

 

Your 15 seconds will encourage us to work even harder
Please share your happy experience on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *