{"id":69,"date":"2026-05-19T14:59:04","date_gmt":"2026-05-19T14:59:04","guid":{"rendered":"https:\/\/gigz.pk\/cpp\/?post_type=lesson&#038;p=69"},"modified":"2026-05-22T07:38:15","modified_gmt":"2026-05-22T07:38:15","slug":"arithmetic-operators","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/cpp\/?lesson=arithmetic-operators","title":{"rendered":"Arithmetic Operators"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Arithmetic operators in C++ are used to perform mathematical calculations on variables and values. They are commonly used in programs for calculations and problem-solving.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What are Arithmetic Operators?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Arithmetic operators are symbols used to perform basic mathematical operations such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Addition<\/li>\n\n\n\n<li>Subtraction<\/li>\n\n\n\n<li>Multiplication<\/li>\n\n\n\n<li>Division<\/li>\n\n\n\n<li>Modulus<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Types of Arithmetic Operators in C++<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Operator<\/th><th>Operation<\/th><\/tr><\/thead><tbody><tr><td><code>+<\/code><\/td><td>Addition<\/td><\/tr><tr><td><code>-<\/code><\/td><td>Subtraction<\/td><\/tr><tr><td><code>*<\/code><\/td><td>Multiplication<\/td><\/tr><tr><td><code>\/<\/code><\/td><td>Division<\/td><\/tr><tr><td><code>%<\/code><\/td><td>Modulus (Remainder)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Addition Operator (+)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Used to add two values.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;<br>using namespace std;<br><br>int main() {<br>    int a = 10;<br>    int b = 5;<br><br>    cout &lt;&lt; a + b;<br><br>    return 0;<br>}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Output<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>15<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Subtraction Operator (-)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Used to subtract one value from another.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>cout &lt;&lt; 10 - 5;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Multiplication Operator (*)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Used to multiply values.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>cout &lt;&lt; 4 * 3;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Division Operator (\/)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Used to divide values.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>cout &lt;&lt; 20 \/ 5;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Modulus Operator (%)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Used to find the remainder after division.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>cout &lt;&lt; 10 % 3;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Output<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>1<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Complete Example Program<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;<br>using namespace std;<br><br>int main() {<br>    int a = 20;<br>    int b = 5;<br><br>    cout &lt;&lt; \"Addition: \" &lt;&lt; a + b &lt;&lt; endl;<br>    cout &lt;&lt; \"Subtraction: \" &lt;&lt; a - b &lt;&lt; endl;<br>    cout &lt;&lt; \"Multiplication: \" &lt;&lt; a * b &lt;&lt; endl;<br>    cout &lt;&lt; \"Division: \" &lt;&lt; a \/ b &lt;&lt; endl;<br>    cout &lt;&lt; \"Modulus: \" &lt;&lt; a % b &lt;&lt; endl;<br><br>    return 0;<br>}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Output<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>Addition: 25<br>Subtraction: 15<br>Multiplication: 100<br>Division: 4<br>Modulus: 0<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Important Points<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Division between integers gives integer result<\/li>\n\n\n\n<li>Modulus operator works only with integers<\/li>\n\n\n\n<li>Arithmetic operators are widely used in calculations<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Why Arithmetic Operators are Important<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">They are important because they:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Perform mathematical calculations<\/li>\n\n\n\n<li>Help solve programming problems<\/li>\n\n\n\n<li>Are used in formulas and algorithms<\/li>\n\n\n\n<li>Support data processing<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Real-Life Example<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Arithmetic operators are used in:<\/p>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1779435529176\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Calculating marks<\/li>\n\n\n\n<li>Finding salary<\/li>\n\n\n\n<li>Shopping bills<\/li>\n\n\n\n<li>Banking systems<\/li>\n\n\n\n<li>Scientific calculations<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Arithmetic operators in C++ are essential tools for performing mathematical operations. They help programs process data, solve calculations, and build logical applications efficiently.<\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/cpp\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">C++ Fundamentals (Beginner Level) > Operators and Conditions > Arithmetic Operators<\/span><\/span><\/div>","protected":false},"menu_order":11,"template":"","class_list":["post-69","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Arithmetic Operators - Learn C++Language with GiGz.PK<\/title>\n<meta name=\"description\" content=\"Learn C++ arithmetic operators (+, -, *, \/, %) with examples for calculations, problem solving, and programming basics.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arithmetic Operators - Learn C++Language with GiGz.PK\" \/>\n<meta property=\"og:description\" content=\"Learn C++ arithmetic operators (+, -, *, \/, %) with examples for calculations, problem solving, and programming basics.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn C++Language with GiGz.PK\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-22T07:38:15+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/cpp\\\/?lesson=arithmetic-operators\",\"url\":\"https:\\\/\\\/gigz.pk\\\/\",\"name\":\"Arithmetic Operators - Learn C++Language with GiGz.PK\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/cpp\\\/#website\"},\"datePublished\":\"2026-05-19T14:59:04+00:00\",\"dateModified\":\"2026-05-22T07:38:15+00:00\",\"description\":\"Learn C++ arithmetic operators (+, -, *, \\\/, %) with examples for calculations, problem solving, and programming basics.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/cpp\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ Fundamentals (Beginner Level) > Operators and Conditions > Arithmetic Operators\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/cpp\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/cpp\\\/\",\"name\":\"Learn C++Language with GiGz.PK\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/cpp\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Arithmetic Operators - Learn C++Language with GiGz.PK","description":"Learn C++ arithmetic operators (+, -, *, \/, %) with examples for calculations, problem solving, and programming basics.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gigz.pk\/","og_locale":"en_US","og_type":"article","og_title":"Arithmetic Operators - Learn C++Language with GiGz.PK","og_description":"Learn C++ arithmetic operators (+, -, *, \/, %) with examples for calculations, problem solving, and programming basics.","og_url":"https:\/\/gigz.pk\/","og_site_name":"Learn C++Language with GiGz.PK","article_modified_time":"2026-05-22T07:38:15+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/cpp\/?lesson=arithmetic-operators","url":"https:\/\/gigz.pk\/","name":"Arithmetic Operators - Learn C++Language with GiGz.PK","isPartOf":{"@id":"https:\/\/gigz.pk\/cpp\/#website"},"datePublished":"2026-05-19T14:59:04+00:00","dateModified":"2026-05-22T07:38:15+00:00","description":"Learn C++ arithmetic operators (+, -, *, \/, %) with examples for calculations, problem solving, and programming basics.","breadcrumb":{"@id":"https:\/\/gigz.pk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/cpp"},{"@type":"ListItem","position":2,"name":"C++ Fundamentals (Beginner Level) > Operators and Conditions > Arithmetic Operators"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/cpp\/#website","url":"https:\/\/gigz.pk\/cpp\/","name":"Learn C++Language with GiGz.PK","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/cpp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/cpp\/index.php?rest_route=\/wp\/v2\/lesson\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/cpp\/index.php?rest_route=\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/cpp\/index.php?rest_route=\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/cpp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}