JavaScript Program on Arithmetic Operators

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

Program 1

// let a=4
// let b=10
// console.log(a**2)  // 5*5
// console.log((a*2)**2)  
// console.log("Addition: " + (a+b))
// console.log("sub: " + (a-b))
// console.log("Multiplication: " + (a*b))
// console.log("Division: " + (a/b))
// console.log("Mod: " + (a%b))  

    // let a=(10*2/2+5)-4 
    // console.log(a)

  /* 
          () { }  []
            /   *  %
            +  - 
  */ 

        //  console.log(50+10)    // 60  Addition
        //  console.log("50"+"10")  // 5010  // Concat
        //  console.log("10"+50) 
        //  console.log(40+20+"10")  ///  60 + "10" --->6010
        //  console.log("10"+40+20)  // 104020
              console.log("40"-10 + "40")  //3040
              console.log("Hello" - "Indore") // NaN

 

Did you like this article? If Yes, please give DataFlair 5 Stars on Google

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

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