<?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: Monsif</title>
    <description>The latest articles on DEV Community by Monsif (@monsif_coder).</description>
    <link>https://dev.to/monsif_coder</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%2F1146493%2F8914906e-1833-4db0-96d8-eaa920c2b247.png</url>
      <title>DEV Community: Monsif</title>
      <link>https://dev.to/monsif_coder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/monsif_coder"/>
    <language>en</language>
    <item>
      <title>Utilizing ASCII in C Programming for Symbol Identification in Passwords</title>
      <dc:creator>Monsif</dc:creator>
      <pubDate>Tue, 14 Nov 2023 17:09:10 +0000</pubDate>
      <link>https://dev.to/monsif_coder/utilizing-ascii-in-c-programming-for-symbol-identification-in-passwords-4f8e</link>
      <guid>https://dev.to/monsif_coder/utilizing-ascii-in-c-programming-for-symbol-identification-in-passwords-4f8e</guid>
      <description>&lt;p&gt;In the realm of password security, robust validation criteria are essential. One critical aspect is ensuring the inclusion of symbols to enhance password strength. Here, we'll delve into the utilization of ASCII values in C programming to precisely identify symbols within passwords, significantly contributing to comprehensive password validation.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;Consider the following C program snippet:&lt;/em&gt;
&lt;/h2&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;h1&gt;
  
  
  include 
&lt;/h1&gt;

&lt;p&gt;// Global boolean variables for criteria&lt;br&gt;
bool lower = false, upper = false, digit = false, symbol = false;&lt;/p&gt;

&lt;p&gt;bool valid(string password);&lt;/p&gt;

&lt;p&gt;int main(void)&lt;br&gt;
{&lt;br&gt;
    string password = get_string("Enter your password: ");&lt;br&gt;
    if (valid(password))&lt;br&gt;
    {&lt;br&gt;
        printf("Your password is valid!\n");&lt;br&gt;
    }&lt;br&gt;
    else&lt;br&gt;
    {&lt;br&gt;
        printf("Your password needs at least one uppercase letter, lowercase letter, number, and symbol\n");&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;bool valid(string password)&lt;br&gt;
{&lt;br&gt;
    for (int i = 0; password[i] != '\0'; i++)&lt;br&gt;
    {&lt;br&gt;
        // Check for lowercase, uppercase, and digits (not shown for brevity)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    // Check for symbols using ASCII values
    if ((password[i] &amp;gt;= 33 &amp;amp;&amp;amp; password[i] &amp;lt;= 47) ||
        (password[i] &amp;gt;= 58 &amp;amp;&amp;amp; password[i] &amp;lt;= 64) ||
        (password[i] &amp;gt;= 91 &amp;amp;&amp;amp; password[i] &amp;lt;= 96))
    {
        symbol = true;
    }
    else
    {
        return false;
    }
}

// Ensure all criteria are met before considering the password valid
if (lower &amp;amp;&amp;amp; upper &amp;amp;&amp;amp; digit &amp;amp;&amp;amp; symbol)
{
    return true;
}
else
{
    return false;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

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

&lt;p&gt;This code snippet showcases the use of ASCII values in C programming to identify symbols within passwords. ASCII, the American Standard Code for Information Interchange, assigns numerical values to characters, including symbols.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key points highlighted in the code snippet:
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Understanding ASCII Ranges:
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ASCII values for symbols occupy specific ranges. For instance, the exclamation mark '!' falls within the range of ASCII values 33 to 47, while other symbols like '@', '[', ']', etc., are situated in different ranges.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Symbol Identification Logic:
&lt;/h2&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    By employing logical conditions (&amp;gt;= and &amp;lt;=), the code checks each character in the password against defined ASCII ranges representing symbols. If a character falls within these ranges, it is recognized as a symbol.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Ensuring Comprehensive Password Validation:
&lt;/h2&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    The program aims to ensure the password contains at least one lowercase letter, uppercase letter, number, and symbol. The ASCII-based symbol check adds another layer of security to password validation.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Augmenting Password Security:
&lt;/h2&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    Incorporating symbols in passwords strengthens their resilience against potential attacks. The utilization of ASCII values aids in efficiently identifying symbols, fortifying the overall security of passwords.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In conclusion, leveraging ASCII values in C programming to identify symbols within passwords is a crucial step in enhancing password security. By employing these techniques, password systems can reinforce their defenses against security threats.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Art of Series Summation in C: Navigating Data Types, Casting Magic, and the Dance of Incrementation</title>
      <dc:creator>Monsif</dc:creator>
      <pubDate>Fri, 10 Nov 2023 12:15:59 +0000</pubDate>
      <link>https://dev.to/monsif_coder/demystifying-the-art-of-series-summation-in-c-navigating-data-types-casting-magic-and-the-dance-of-incrementation-2ic7</link>
      <guid>https://dev.to/monsif_coder/demystifying-the-art-of-series-summation-in-c-navigating-data-types-casting-magic-and-the-dance-of-incrementation-2ic7</guid>
      <description>&lt;p&gt;Greetings, fellow coding enthusiasts! Today, let's embark on an exciting journey into the world of C programming. If you're new to coding, fear not – we're about to unravel the secrets behind a common programming challenge. Picture this: you're faced with the task of calculating the value of a series, a challenge that involves mastering the art of data types, casting magic, and the dance of incrementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge.
&lt;/h2&gt;

&lt;p&gt;Our mission is deceptively simple but carries profound lessons. We aim to calculate the value of the series S=1+21​+31​+…+501​.&lt;/p&gt;

&lt;p&gt;here is the code for Our little program:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;


int main (){
    float count;
    float s = 0;
    for (int  i = 1; i &amp;lt;= 50; i++)
    {
        count = (float)1 / i;
        s += count;

    }
    printf("%.2f", s);
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Choosing the Right Tools:
&lt;/h2&gt;

&lt;p&gt;Think of coding like an artist picking the right colors. We used a tool called 'float' to handle our numbers with decimals. It helps us keep track of the small parts of our series.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Casting Game:
&lt;/h2&gt;

&lt;p&gt;Here's where we did a little magic trick. When we divided 1 by our counting number 'i' ( 'i' represents the loop counter), there was a tiny problem. But, no worries! We used a trick called 'casting' to make sure our result had those cool decimal points. It's like turning 1 into 1.0 for our math dance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;count = (float)1 / i;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Simple Loop:
&lt;/h2&gt;

&lt;p&gt;Think of this like taking steps on a staircase. We started counting from 1 to 50, and with each count, our calculation 1 / i&lt;br&gt;
changed a bit. The cool part happened when we added this new result to our total. We kept moving up the steps until we reached the end of our series.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;s += count;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;p&gt;And there you have it! We took on a coding challenge, used our tools wisely, did a little trick to keep our numbers accurate, and moved through a simple loop to find the series value. Coding is like climbing a staircase – it gets more enjoyable when you understand the steps.&lt;/p&gt;

&lt;p&gt;So, keep it simple, enjoy the coding journey, and may your code always move in the right direction!&lt;/p&gt;

&lt;p&gt;Happy coding,&lt;br&gt;
Monsif Lam.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>datatypes</category>
      <category>casting</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Discovering the Magic of 'do-while' Loops in C Programming</title>
      <dc:creator>Monsif</dc:creator>
      <pubDate>Fri, 25 Aug 2023 20:21:42 +0000</pubDate>
      <link>https://dev.to/monsif_coder/discovering-the-magic-of-do-while-loops-in-c-programming-1io9</link>
      <guid>https://dev.to/monsif_coder/discovering-the-magic-of-do-while-loops-in-c-programming-1io9</guid>
      <description>&lt;p&gt;Hello there, curious minds and aspiring programmers! Today, let's take a journey into the world of C programming. Don't worry if you've never coded before; we're going to explore an exciting concept called loop structures. Imagine loops as a way for your program to repeat certain tasks efficiently. Among these loops, there's one gem we're going to spotlight: the 'do-while' loop.&lt;/p&gt;

&lt;p&gt;Unveiling the Mystery of 'do-while' Loops:&lt;/p&gt;

&lt;p&gt;Let's paint a simple picture. Imagine you're writing a computer program using C, and you have a task that needs to be repeated, like checking if an entered number is valid. You could use different types of loops, but today, let's focus on the friendly 'do-while' loop.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Achieve More with Less Code:&lt;br&gt;
Here's the cool thing: the 'do-while' loop lets you achieve tasks using fewer lines of code. Unlike some other loops, the 'do-while' loop ensures that the code inside it is executed at least once, even before checking if a condition is met. This means you don't need to repeat the same code outside the loop before entering it. The result? Cleaner, more efficient code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Embrace the First Step:&lt;br&gt;
Imagine you want to do something before you even start checking a condition. This is where the 'do-while' loop shines. It makes sure that your code inside the loop is carried out before deciding whether the condition is true or not. This is great for situations where you want certain actions to happen no matter what.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Classy Input Checking:&lt;br&gt;
Let's say you're making a program that asks users for input, like their age. You want to make sure they enter a sensible value. The 'do-while' loop is like your trusty sidekick here. It shows the user the prompt before checking if their input is okay. You won't need to repeat the prompt again and again, making the interaction smoother and less cluttered.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Making Code Easier on the Eyes:&lt;br&gt;
When writing code, making it easy to read and understand is super important. The 'do-while' loop helps here too. By wrapping the whole loop structure, including the initial step, it simplifies your code. It's like presenting your ideas in a neat package. This makes future changes and updates a breeze, making your coding experience more enjoyable.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Wrapping Up:&lt;/p&gt;

&lt;p&gt;As you delve into the world of C programming, remember the 'do-while' loop. It's like a handy tool in your coding toolbox. It can simplify your code, handle input validation with grace, and make your programs easier to understand. With a bit of practice, you'll be creating well-structured, efficient, and easy-to-maintain code.&lt;/p&gt;

&lt;p&gt;So, cheers to embracing the magic of the 'do-while' loop in your coding adventures. May your code be neat, your validations rock-solid, and your journey through loops be truly enlightening!&lt;/p&gt;

&lt;p&gt;Wishing you happy coding,&lt;br&gt;
Monsif Lam&lt;/p&gt;

</description>
      <category>lowlevelprogramming</category>
      <category>c</category>
      <category>cleancode</category>
    </item>
  </channel>
</rss>
