<?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: Sahaja</title>
    <description>The latest articles on DEV Community by Sahaja (@shj).</description>
    <link>https://dev.to/shj</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F625268%2F0976edec-db1d-4849-afa8-b988cfea84d5.jpg</url>
      <title>DEV Community: Sahaja</title>
      <link>https://dev.to/shj</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shj"/>
    <language>en</language>
    <item>
      <title>Project Euler #1 - Multiples of 3 and 5</title>
      <dc:creator>Sahaja</dc:creator>
      <pubDate>Fri, 03 Sep 2021 14:37:47 +0000</pubDate>
      <link>https://dev.to/shj/project-euler-1-multiples-of-3-and-5-59ci</link>
      <guid>https://dev.to/shj/project-euler-1-multiples-of-3-and-5-59ci</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Question no. 1 :&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.&lt;br&gt;
Find the sum of all the multiples of 3 or 5 below 1000.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;iostream&amp;gt;
using namespace std;
int main(){
  int sum3=0;
  int sum5=0; 
  int sum15=0;
  for (int i=1;i&amp;lt;=333;i++){
       sum3= i + sum3;
  }
  for (int i=1;i&amp;lt;=199;i++){
       sum5= i + sum5;
  }
  for (int i=1;i&amp;lt;=66;i++){
       sum15= i + sum15;
  }
 int total = 3*sum3+5*sum5-15*sum15;
 cout&amp;lt;&amp;lt;"Sum of multiples of 3 or 5 : "&amp;lt;&amp;lt;total;

return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Output :
 Sum of multiples of 3 or 5 : 233168 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>projecteuler</category>
      <category>cpp</category>
    </item>
  </channel>
</rss>
