{"id":774,"date":"2022-07-11T08:29:03","date_gmt":"2022-07-11T08:29:03","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=774"},"modified":"2023-04-22T19:25:13","modified_gmt":"2023-04-22T19:25:13","slug":"javascript-arithmetic-operators","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/javascript-arithmetic-operators\/","title":{"rendered":"Arithmetic Operators in Javascript"},"content":{"rendered":"\n<p class=\"has-text-align-center\"><strong>Arithmetic Operators in Javascript<\/strong><\/p>\n\n\n\n<p>These are the operators which perform arithmetic operations in <a href=\"https:\/\/gyanipandit.com\/programming\/category\/javascript-tutorial\/\">Javascript<\/a> on the numbers.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Arithmetic Operators in Javascript | Lecture 9 | JavaScript for Beginners\" width=\"696\" height=\"392\" src=\"https:\/\/www.youtube.com\/embed\/X2SFCGpEJN8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Here is a list of some arithmetic <a href=\"https:\/\/gyanipandit.com\/programming\/javascript-operators\/\">operators in Javascript,<\/a> with their descriptions in brief &#8212;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Operator<\/td><td>Description<\/td><\/tr><tr><td>+<\/td><td>This operator is used for the addition operation<\/td><\/tr><tr><td>&#8211;<\/td><td>This operator is used for the subtraction operation<\/td><\/tr><tr><td>*<\/td><td>This operator is used for a multiplication operation<\/td><\/tr><tr><td>\/<\/td><td>This operator is used for division operation<\/td><\/tr><tr><td>%<\/td><td>This operator is used to get the remainder when we divide two numbers.<\/td><\/tr><tr><td>**<\/td><td>This operator is used to calculate the power of some number. For example, 2**4 can compute the 4thpower of 2.<\/td><\/tr><tr><td>++<\/td><td>This operator is used for incrementation operation, i.e adding 1 to some number.<\/td><\/tr><tr><td>&#8212;<\/td><td>This operator is used for decrementation operation, i.e subtracting 1 from some number.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Now, let&#8217;s have a look at a program, with which, we can better understand the use of arithmetic operators &#8211;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"834\" height=\"432\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/Arithmetic-Operators.jpg\" alt=\"\" class=\"wp-image-775\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/Arithmetic-Operators.jpg 834w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/Arithmetic-Operators-300x155.jpg 300w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/Arithmetic-Operators-768x398.jpg 768w\" sizes=\"auto, (max-width: 834px) 100vw, 834px\" \/><\/figure>\n<\/div>\n\n\n<p>As you can see in the above program, we have tried using some arithmetic operations, which help us in arithmetic operations, like addition, subtraction, multiplication, division, etc. So, now let&#8217;s have a look at the output &#8211;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"361\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/Arithmetic-Operators-1.jpg\" alt=\"\" class=\"wp-image-776\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/Arithmetic-Operators-1.jpg 576w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/04\/Arithmetic-Operators-1-300x188.jpg 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/figure>\n<\/div>\n\n\n<p>So, you can use the arithmetic operators, as we have used them in the above program for demonstration purposes. We are going to make use of the arithmetic operators, as and when required. You would get familiar with the concept, as we keep on using it. You can try observing the outputs, and also try using some symbols by yourself.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Arithmetic Operators in Javascript These are the operators which perform arithmetic operations in Javascript on the numbers. Here is a list of some arithmetic operators in Javascript, with their descriptions in brief &#8212; Operator Description + This operator is used for the addition operation &#8211; This operator is used for the subtraction operation * This [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[14,15],"class_list":{"0":"post-774","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-javascript-tutorial","7":"tag-javascript","8":"tag-javascript-tutorial"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/774","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=774"}],"version-history":[{"count":5,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/774\/revisions"}],"predecessor-version":[{"id":6029,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/774\/revisions\/6029"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=774"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=774"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}