<?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: Vivin Kingsly V</title>
    <description>The latest articles on DEV Community by Vivin Kingsly V (@vivin_kingslyv_f87d48df3).</description>
    <link>https://dev.to/vivin_kingslyv_f87d48df3</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%2F3691215%2Fc3a588e7-b872-4b03-bb78-779bebeaa791.png</url>
      <title>DEV Community: Vivin Kingsly V</title>
      <link>https://dev.to/vivin_kingslyv_f87d48df3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vivin_kingslyv_f87d48df3"/>
    <language>en</language>
    <item>
      <title>prime number</title>
      <dc:creator>Vivin Kingsly V</dc:creator>
      <pubDate>Sat, 03 Jan 2026 12:46:10 +0000</pubDate>
      <link>https://dev.to/vivin_kingslyv_f87d48df3/prime-number-lck</link>
      <guid>https://dev.to/vivin_kingslyv_f87d48df3/prime-number-lck</guid>
      <description>&lt;h2&gt;
  
  
  1. The Logic Building (The Strategy)
&lt;/h2&gt;

&lt;p&gt;The general rule for a Prime number is that it’s only divisible by 1 and itself. However, I realized a common confusion: Composite numbers (like 4) are also divisible by 1 and themselves.&lt;/p&gt;

&lt;p&gt;Prime Number (e.g., 5): When divided by every number from 1 to itself, it produces a remainder of zero exactly two times (1 and 5).&lt;/p&gt;

&lt;p&gt;Composite Number (e.g., 4): It produces a remainder of zero more than two times (1, 2, and 4).&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Recipe Writing (The Algorithm)
&lt;/h2&gt;

&lt;p&gt;I treated my code like a recipe:&lt;/p&gt;

&lt;p&gt;Input: Get the number.&lt;/p&gt;

&lt;p&gt;Loop: Check every number from 1 up to the input number.&lt;/p&gt;

&lt;p&gt;Check Remainder: Use the modulo operation (%) to find where the remainder is 0.&lt;/p&gt;

&lt;p&gt;Counter: Count how many times the remainder was 0.&lt;/p&gt;

&lt;p&gt;Final Result: If the count is exactly 2, it's Prime. Otherwise, it’s Composite.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The Ingredients (The Variables)
&lt;/h2&gt;

&lt;p&gt;I gathered my "ingredients" for the Java code:&lt;/p&gt;

&lt;p&gt;input: The number to check.&lt;/p&gt;

&lt;p&gt;count: To track the number of divisors.&lt;/p&gt;

&lt;p&gt;for loop: &lt;/p&gt;

&lt;p&gt;Start:1(Initialization)&lt;br&gt;
End:Input(Condition)&lt;br&gt;
Next step:+1(Increment)&lt;/p&gt;

&lt;p&gt;if-else: To handle the logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Program(Javascript):&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;var a = 24&lt;br&gt;
var c = 0&lt;/p&gt;

&lt;p&gt;for (i = 1; i &amp;lt;= a; i++) &lt;br&gt;
{&lt;br&gt;
    if (a % i == 0)&lt;br&gt;
    {&lt;br&gt;
        c++&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;if (c == 2)&lt;br&gt;
{&lt;br&gt;
    console.log("Prime")&lt;br&gt;
}&lt;br&gt;
else&lt;br&gt;
{&lt;br&gt;
    console.log("Not Prime") &lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
