<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ayan</title>
    <description>The latest articles on DEV Community by Ayan (@xkaper).</description>
    <link>https://dev.to/xkaper</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1045264%2F45110f43-27d8-41e8-9076-5e80f7973a1b.jpg</url>
      <title>DEV Community: Ayan</title>
      <link>https://dev.to/xkaper</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xkaper"/>
    <language>en</language>
    <item>
      <title>Packaging and Distributing Flutter Desktop Apps: The Missing Guide for Open Source &amp; Indie Developers - Packaging choco packages</title>
      <dc:creator>Ayan</dc:creator>
      <pubDate>Tue, 11 Feb 2025 11:54:06 +0000</pubDate>
      <link>https://dev.to/xkaper/packaging-and-distributing-flutter-desktop-apps-the-missing-guide-for-open-source-indie-5841</link>
      <guid>https://dev.to/xkaper/packaging-and-distributing-flutter-desktop-apps-the-missing-guide-for-open-source-indie-5841</guid>
      <description>&lt;p&gt;&lt;em&gt;by Ayan Gupta (&lt;a href="https://linkedin.com/in/xkaper001" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;, &lt;a href="https://x.com/xkaper001" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Creating a Chocolatey package from an EXE file allows you to distribute and automate your software installation on Windows systems. This guide will walk you through the process step-by-step.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We'll learn with an example of &lt;a href="https://github.com/foss42/apidash" rel="noopener noreferrer"&gt;foss42/apidash&lt;/a&gt; .exe package which can be found &lt;a href="https://github.com/foss42/apidash/releases/latest/download/apidash-windows-x86_64.exe" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Chocolatey Installed: Ensure Chocolatey is installed on your system. 
refer Chocolatey Software | Installing Chocolatey&lt;/li&gt;
&lt;li&gt;EXE File: Have the installer executable (EXE file) of your application ready.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 1: Setup Skeleton
&lt;/h2&gt;

&lt;p&gt;First step towards making a choco package is initializing a base.&lt;/p&gt;

&lt;p&gt;The command &lt;code&gt;choco new -h&lt;/code&gt; can teach you more about the &lt;code&gt;new&lt;/code&gt; command, its usage, options, switches, and exit codes.&lt;/p&gt;

&lt;p&gt;Run the following command to setup the base&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;new&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"apidash"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--version&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"0.3.0"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;maintainername&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"foss42"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;maintainerrepo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/foss42/apidash"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--built-in-template&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Explanation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;choco new&lt;/code&gt;: Creates the structure and necessary files for a new Chocolatey package.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--name="apidash"&lt;/code&gt;: Specifies the name of the package, in this case, "apidash."&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--version="0.3.0"&lt;/code&gt;: Sets the initial version of the package to &lt;code&gt;0.3.0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;maintainername="foss42"&lt;/code&gt;: Adds the name of the package maintainer, which is "foss42" in this example.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;maintainerrepo="https://github.com/foss42/apidash"&lt;/code&gt;: Specifies the repository URL associated with the package, typically the source code or documentation link for "apidash."&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--built-in-template&lt;/code&gt;: Uses Chocolatey's built-in package template to scaffold the package structure, including essential files like &lt;code&gt;nuspec&lt;/code&gt; and script files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzxebtal5tt1u2o4n5hp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzxebtal5tt1u2o4n5hp.png" alt="choco folder structure" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This creates the following folder structure&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apidash
├── ReadMe.md
├── _TODO.txt
├── apidash.nuspec
└── tools
    ├── chocolateybeforemodify.ps1
    ├── chocolateyinstall.ps1
    ├── chocolateyuninstall.ps1
    ├── LICENSE.txt
    └── VERIFICATION.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The files &lt;code&gt;ReadMe.md&lt;/code&gt; and &lt;code&gt;_TODO.md&lt;/code&gt; can be deleted before pushing.&lt;/p&gt;

&lt;p&gt;The files of our main interest are &lt;code&gt;chocolateyinstall.ps1&lt;/code&gt; and &lt;code&gt;apidash.nuspec&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Editing &lt;code&gt;chocolateyinstall.ps1&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Take a look at &lt;code&gt;chocolateyinstall.ps1&lt;/code&gt; file. There are many comments stating the use case of each line itself.&lt;/p&gt;

&lt;p&gt;Update the following fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;url&lt;/code&gt;/&lt;code&gt;url64&lt;/code&gt;: To the URL of the .exe file hosted. In our case, it is &lt;code&gt;https://github.com/foss42/apidash/releases/latest/download/apidash-windows-x86_64.exe&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;filetype&lt;/code&gt;: Could be either &lt;code&gt;exe&lt;/code&gt;, &lt;code&gt;msi&lt;/code&gt;, or &lt;code&gt;msu&lt;/code&gt;. In our case, it is an &lt;code&gt;exe&lt;/code&gt; file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;checksum&lt;/code&gt;/&lt;code&gt;checksum64&lt;/code&gt;: set to the checksum of the .exe file for choco to match the hashes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;silentArgs&lt;/code&gt;: '/S' for .exe file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;validExitCodes&lt;/code&gt;: &lt;code&gt;@(0)&lt;/code&gt; &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remove all the comments using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$f&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'apidash\tools\chocolateyinstall.ps1'&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="n"&gt;gc&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$f&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;?&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;$_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-notmatch&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^\s*#"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="bp"&gt;$_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-replace&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;'(^.*?)\s*? [^``]#.*'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'$1'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Out-File&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$f&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;".~"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-en&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;utf8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mv&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-fo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$f&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;".~"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$f&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fboc5lcstslju2qtey9cm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fboc5lcstslju2qtey9cm.png" alt="chocolatelyinstall.ps1" width="800" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now our &lt;code&gt;chocolateyinstall.ps1&lt;/code&gt; file is ready.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Editing &lt;code&gt;apidash.nuspec&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Change the following tags accordingly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;authors&lt;/code&gt;: Name of author of software.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;projectUrl&lt;/code&gt;: Url of the project. (maybe the one hosted on GitHub/Gitlab)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;iconUrl&lt;/code&gt;: Url of the icon. (you could use &lt;a href="//githack.com"&gt;githack.com&lt;/a&gt; if icon is in your repo itself)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;summary&lt;/code&gt;: a summary of the package. &lt;/li&gt;
&lt;li&gt;
&lt;code&gt;description&lt;/code&gt;: description of the package.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tags&lt;/code&gt;: tags specific to your package.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2km555bocw3upnkulj1y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2km555bocw3upnkulj1y.png" alt="final apidash.nuspec" width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Build the package
&lt;/h2&gt;




&lt;p&gt;All our files are ready, we just need to pack out files in a choco package with the extension &lt;code&gt;.nupkg&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Run the following command from the root of your directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pack&lt;/span&gt;&lt;span class="w"&gt; 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command generates the &lt;code&gt;apidash.0.3.0.nupkg&lt;/code&gt; file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5: Test the Package Locally
&lt;/h2&gt;

&lt;p&gt;Install the package locally using Chocolatey:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;apidash&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure the application installs correctly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F98yzsrhm1tnld8ylatt3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F98yzsrhm1tnld8ylatt3.png" alt="Shell output" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6: Pre-Publishing - Update &lt;code&gt;LICENSE.txt&lt;/code&gt; &amp;amp; &lt;code&gt;VERIFICATION.txt&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Update &lt;code&gt;LICENSE.txt&lt;/code&gt; with the actual **LICENSE **and &lt;code&gt;VERIFICATION.txt&lt;/code&gt; accordingly.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 7: Publish the Package (Optional)
&lt;/h2&gt;

&lt;p&gt;To share the package, you can push it to a Chocolatey repository. For the official Chocolatey Community Repository, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an account on the Chocolatey Community.&lt;/li&gt;
&lt;li&gt;Get an API key by navigating to your profile.&lt;/li&gt;
&lt;li&gt;Use the following command to push your package:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;choco&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;MyPackage.1.0.0.nupkg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://push.chocolatey.org/"&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--api-key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"YOUR_API_KEY"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Creating a Chocolatey package from an EXE file simplifies software deployment on Windows systems. By following the steps outlined in this guide, you can easily build, test, and publish your custom Chocolatey package.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>tutorial</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Arithemetic Operators in C++</title>
      <dc:creator>Ayan</dc:creator>
      <pubDate>Thu, 20 Jul 2023 17:20:14 +0000</pubDate>
      <link>https://dev.to/xkaper/arithemetic-operators-in-c-56b9</link>
      <guid>https://dev.to/xkaper/arithemetic-operators-in-c-56b9</guid>
      <description>&lt;p&gt;Arithmetic operators are used for performing basic mathematical operations on variables or values. C++ provides a set of standard arithmetic operators that you can use to perform addition, subtraction, multiplication, division, and more. Let's go through each arithmetic operator one by one:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Addition (+):
&lt;/h4&gt;

&lt;p&gt;The addition operator (+) is used to add two operands together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// result will be 30&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Subtraction (-):
&lt;/h4&gt;

&lt;p&gt;The subtraction operator (-) is used to subtract the right-hand operand from the left-hand operand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// result will be 20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Multiplication (*):
&lt;/h4&gt;

&lt;p&gt;The multiplication operator (*) is used to multiply two operands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// result will be 30&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  4. Division (/):
&lt;/h4&gt;

&lt;p&gt;The division operator (/) is used to divide the left-hand operand by the right-hand operand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// result will be 10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  5. Modulus (%):
&lt;/h4&gt;

&lt;p&gt;The modulus operator (%) is used to find the remainder when the left-hand operand is divided by the right-hand operand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// result will be 2 (remainder of 20 / 6)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  6. Increment (++) and Decrement (--):
&lt;/h4&gt;

&lt;p&gt;The increment operator (++) is used to increase the value of a variable by one, and the decrement operator (--) is used to decrease the value of a variable by one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// a will be 6&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// a will be 5 again&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  7. Compound Assignment Operators (+=, -=, *=, /=, %=):
&lt;/h4&gt;

&lt;p&gt;C++ also provides compound assignment operators, which combine an arithmetic operation with assignment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// equivalent to a = a + 5; (a will be 15)&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// equivalent to a = a - 3; (a will be 12)&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// equivalent to a = a * 2; (a will be 24)&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// equivalent to a = a / 4; (a will be 6)&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;%=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// equivalent to a = a % 5; (a will be 1)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep in mind that arithmetic operators have certain rules and precedence in C++. Parentheses can be used to control the order of evaluation.&lt;/p&gt;

&lt;p&gt;Remember to use appropriate data types when using arithmetic operators to avoid potential overflow or precision issues, especially with floating-point numbers.&lt;/p&gt;

&lt;p&gt;That's a summary of arithmetic operators in C++. They are essential for performing basic mathematical calculations in your C++ programs. Happy coding!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
