<?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: Guna Sekaran</title>
    <description>The latest articles on DEV Community by Guna Sekaran (@guna_sekaran_).</description>
    <link>https://dev.to/guna_sekaran_</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%2F2521562%2F83a86e41-b907-4747-8230-0e132c797a0c.jpg</url>
      <title>DEV Community: Guna Sekaran</title>
      <link>https://dev.to/guna_sekaran_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/guna_sekaran_"/>
    <language>en</language>
    <item>
      <title>Counting Character Appearances in a String</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Tue, 25 Feb 2025 15:59:55 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/counting-character-appearances-in-a-string-5afi</link>
      <guid>https://dev.to/guna_sekaran_/counting-character-appearances-in-a-string-5afi</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package array;

public class Character_count {

        public static void main(String[] args) {

            String s="Gunasekaran";     
            char[]c=s.toCharArray();

                for(int j=0;j&amp;lt;c.length;j++) {

                    char key=c[j];
                    int count=1;

                    if (key == '*') {
                        continue;
                    }


                for(int i=j+1; i&amp;lt;c.length; i++) {

                    if(key==c[i]) {

                        c[i]='*';
                        count++;
                    }

                }   


                System.out.println(key+"appears"+ count);


                }


        }
}

.........................................................................

OUTPUT:

G Appears 1 Times
u Appears 1 Times
n Appears 2 Times
a Appears 3 Times
s Appears 1 Times
e Appears 1 Times
k Appears 1 Times
r Appears 1 Times

&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;                 FINDING THE CHARACTER WHICH HAS THE ONE COUNT VALUE

package array;

public class Character_count {

        public static void main(String[] args) {

            String s="Gunasekaran";     
            char[]c=s.toCharArray();

                for(int j=0;j&amp;lt;c.length;j++) {

                    char key=c[j];
                    int count=1;

                    if (key == '*') {
                        continue;
                    }


                for(int i=j+1; i&amp;lt;c.length; i++) {

                    if(key==c[i]) {

                        c[i]='*';
                        count++;
                    }

                }   

                if (count == 1) { // using this condition for printing character has one count value 

                System.out.println(key+ " Appears "+ count+ " Times");
                }

                }


        }
}

.........................................................................

OUTPUT:

G Appears 1 Times
u Appears 1 Times
s Appears 1 Times
e Appears 1 Times
k Appears 1 Times
r Appears 1 Times

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Bubble Sorting &amp; Selection Sorting In Java</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Mon, 24 Feb 2025 16:01:02 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/bubble-sorting-selection-sorting-in-java-2jca</link>
      <guid>https://dev.to/guna_sekaran_/bubble-sorting-selection-sorting-in-java-2jca</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package array;

                                 BUBBLE SORTING:                            


public class Bubble_sort {
    public static void main(String[] args) {
         int[] ar = {50, 40, 30, 20, 10};
            for(int j = 1; j &amp;lt; ar.length; j++ ) {
              for(int i = 0; i &amp;lt; ar.length - j; i++) {
                if(ar[i] &amp;gt; ar[i+1]) {
                  int temp = ar[i];
                  ar[i] = ar[i+1];
                  ar[i+1] = temp;
                }
              }
            }
            for(int i = 0; i &amp;lt; ar.length; i++ )
              System.out.print(ar[i]+" ");


    }

}

.........................................................................

OUTPUT:
10 20 30 40 50 
&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;                                SELECTION SORTING:                      

package array;

public class Selection_sort {
    public static void main(String[] args) {
        int[] ar = {9,8,7,6,5,4,3,2,1};
        for(int j = 0; j &amp;lt; ar.length - 1; j++) {
          int big = 0;
          int big_index = 0;
          for(int i = 0; i &amp;lt; ar.length - j; i++) {
            if(ar[i] &amp;gt; big) {
              big_index = i;
              big = ar[i];
            }
          }

          int len = ar.length - (j + 1);
          int temp = ar[len];
          ar[len] = big;
          ar[big_index] = temp;
        }
        for(int i = 0; i &amp;lt; ar.length; i++) {
          System.out.print(ar[i]+" ");
        }




    }

}

.........................................................................

OUTPUT:

1 2 3 4 5 6 7 8 9 10 

&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;                               LINEAR SEARCHING:

package array;

public class Linear_searching {
    public static void main(String[] args) {
        int[]array= {5,8,11,22,24,31,48,88};
        int selected_num=22;
        for(int i=0;i&amp;lt;array.length;i++) {

            if(array[i]==selected_num) {

                System.out.println(selected_num+" "+"is presented in list");


            }

    }

    }
}

.........................................................................

OUTPUT:

22 is presented in list


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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Swapping The numbers in java</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Fri, 21 Feb 2025 15:34:35 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/swapping-the-numbers-in-java-2a</link>
      <guid>https://dev.to/guna_sekaran_/swapping-the-numbers-in-java-2a</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package array;

public class swapping_array {
    public static void main(String[] args) {
        int a=50,b=100;
        int temporary=a;//storing the a value into temporary variable for swapping. now it has 50 in it  

        a=b;     
        b=temporary;  
        System.out.println("a="+a);
        System.out.println("b="+b);
}
}

.........................................................................

OUTPUT:

a=100
b=50


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

&lt;/div&gt;



&lt;p&gt;Another method for swapping the variables Without Creating new Variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package array;

public class swapping_array {
    public static void main(String[] args) {

    int a=5,b=6;
    a=a+b;//a=11
    b=a-b;//b=11-6 b=5 (b value changed into 5)
    a=a-b;//a=11-5 a=6 (a value changed into 6)

        System.out.println("a="+a);
        System.out.println("b="+b);
}
}

.........................................................................

OUTPUT:

a=6
b=5

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Java Program For Finding First And Second Highest Scores</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Thu, 20 Feb 2025 15:11:43 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/java-program-for-finding-first-and-second-highest-scores-1glp</link>
      <guid>https://dev.to/guna_sekaran_/java-program-for-finding-first-and-second-highest-scores-1glp</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package array;

        public class gratest_value {
            public static void main(String[] args) {    

        int[]marks= {75,78,76,67,95};
        String[]subjects={"tamil","english","maths","science","social"};
        int first_highscore=0,second_highscore=0;
        for(int i=0;i &amp;lt;marks.length; i++) {

            if(marks[i]&amp;gt;first_highscore) {
               second_highscore=first_highscore;
               first_highscore=marks[i];    
            }
            else if(marks[i]&amp;gt;second_highscore){
                second_highscore=marks[i];
            }

        }
        System.out.println("first highest score is:"+first_highscore);
        System.out.println("second highest score is:"+second_highscore);






    }
}

.........................................................................

OUTPUT:

first highest score is:95
second highest score is:78

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Using Scanner class in java Program</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Tue, 18 Feb 2025 16:06:10 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/using-scanner-class-in-java-program-635</link>
      <guid>https://dev.to/guna_sekaran_/using-scanner-class-in-java-program-635</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package array;

import java.util.Scanner;

public class Scanner_array {
    public static void main(String[] args) {

         Scanner scanner = new Scanner(System.in);
         System.out.println("Enter Your name:");
         String name=scanner.nextLine();
         System.out.println("Welcome to java "+name);

    }

}

.........................................................................

OUTPUT:
Enter Your name:
Guna
Welcome to java Guna

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Array In Java</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Mon, 17 Feb 2025 09:09:36 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/array-in-java-33m2</link>
      <guid>https://dev.to/guna_sekaran_/array-in-java-33m2</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package array;

public class Array_day1 {
    public static void main(String[] args) {

        int[] marks = { 75, 78, 76, 67, 95};
        System.out.println(marks.length + "--length count");// it's a pre-defined method for marks count 
        int total = 0;
        int count=0;

        for (int i = 0; i &amp;lt; marks.length; i++) {
            // we use the marks.length for storing multiple values

            total = total + marks[i];
            count++;

        }
        System.out.println(count+"--normal count");
        System.out.println(total + "--total marks");
        System.out.println(total/5+"%-- percentage");

    }

}

.........................................................................

OUTPUT:
5--length count
5--normal count
391--total marks
78%-- percentage


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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Java Programs for Number Pattern Printing</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Thu, 13 Feb 2025 16:40:42 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/java-programs-for-number-pattern-printing-2ja8</link>
      <guid>https://dev.to/guna_sekaran_/java-programs-for-number-pattern-printing-2ja8</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private static void pattern1() {
        for(int row=1;row&amp;lt;=9;row++)
        {
            for(int col=1;col&amp;lt;=9;col++) {

                if(col==5 || row==9 ||col+row==6 ) {
                    System.out.print("* ");
                    }
                else {
                    System.out.print("  ");
                }
                }

                System.out.println();   

        }   
    }
    }
.........................................................................

OUTPUT:
        *         
      * *         
    *   *         
  *     *         
*       *         
        *         
        *         
        *         
* * * * * * * * * 

&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;private static void pattern2() {
        for(int row=1;row&amp;lt;=9;row++) {
            for(int col=1;col&amp;lt;=9;col++) {
                if(row==1|| col==9&amp;amp;&amp;amp;row&amp;lt;=5||row==5||row==9||col==1&amp;amp;&amp;amp;row&amp;gt;=5) {
                    System.out.print("* ");
                }
                else {
                    System.out.print("  ");
                    }
            }
            System.out.println();
        }

    }

.........................................................................

OUTPUT:

* * * * * * * * * 
                * 
                * 
                * 
* * * * * * * * * 
*                 
*                 
*                 
* * * * * * * * * 

&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;private static void pattern3() {
        for(int row=1;row&amp;lt;=9;row++) {
            for(int col=1;col&amp;lt;=9;col++) {
                if(row==1|| row==9|| col==9|| row==5) {
                    System.out.print("* ");
                }
                else {
                    System.out.print("  ");
                    }
            }
            System.out.println();
        }

    }

.........................................................................

OUTPUT:

* * * * * * * * * 
                * 
                * 
                * 
* * * * * * * * * 
                * 
                * 
                * 
* * * * * * * * * 

&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;private static void pattern4() {
        for(int row=1;row&amp;lt;=9;row++) {
            for(int col=1;col&amp;lt;=9;col++) {
                if(col==1&amp;amp;&amp;amp;row&amp;lt;=6|| row==6|| col==5&amp;amp;&amp;amp;row&amp;gt;=3) {
                    System.out.print("* ");
                }
                else {
                    System.out.print("  ");
                    }
            }
            System.out.println();
        }

    }

.........................................................................

OUTPUT:

*                 
*                 
*       *         
*       *         
*       *         
* * * * * * * * * 
        *         
        *         
        *         

&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;private static void pattern5() {
        for(int row=1;row&amp;lt;=9;row++) {
            for(int col=1;col&amp;lt;=9;col++) {
                if(row==1|| row==9|| row==5|| col==1&amp;amp;&amp;amp;row&amp;lt;=5|| col==9&amp;amp;&amp;amp;row&amp;gt;=5) {
                    System.out.print("* ");
                }
                else {
                    System.out.print("  ");
                    }
            }
            System.out.println();
        }

    }

.........................................................................

OUTPUT:

* * * * * * * * * 
*                 
*                 
*                 
* * * * * * * * * 
                * 
                * 
                * 
* * * * * * * * * 

&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;private static void pattern6() {
        for(int row=1;row&amp;lt;=9;row++) {
            for(int col=1;col&amp;lt;=9;col++) {
                if(row==1|| row==9|| col==1|| row==5 || col==9&amp;amp;&amp;amp;row&amp;gt;=5) {
                    System.out.print("* ");
                }
                else {
                    System.out.print("  ");
                    }
            }
            System.out.println();
        }

    }


    }

.........................................................................

OUTPUT:

* * * * * * * * * 
*                 
*                 
*                 
* * * * * * * * * 
*               * 
*               * 
*               * 
* * * * * * * * * 

&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;private static void pattern7() {

            for(int row=1;row&amp;lt;=9;row++) {
                for(int col=1;col&amp;lt;=9;col++) {
                    if(col==8|| row==1&amp;amp;&amp;amp;col&amp;lt;=8) {
                        System.out.print("* ");
                    }
                    else {
                        System.out.print("  ");
                        }
                }
                System.out.println();
            }

        }
.........................................................................
OUTPUT:

* * * * * * * *   
              *   
              *   
              *   
              *   
              *   
              *   
              *   
              *   

&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;private static void pattern8() {

            for(int row=1;row&amp;lt;=9;row++) {
                for(int col=1;col&amp;lt;=9;col++) {
                    if(row==1|| row==9|| col==1|| row==5 || col==9) {
                        System.out.print("* ");
                    }
                    else {
                        System.out.print("  ");
                        }
                }
                System.out.println();
            }




    }
.........................................................................

OUTPUT:

* * * * * * * * * 
*               * 
*               * 
*               * 
* * * * * * * * * 
*               * 
*               * 
*               * 
* * * * * * * * * 

&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;private static void pattern9() {

            for(int row=1;row&amp;lt;=9;row++) {
                for(int col=1;col&amp;lt;=9;col++) {
                    if(row==1|| col==9|| row==5|| col==1&amp;amp;&amp;amp;row&amp;lt;=5) {
                        System.out.print("* ");
                    }
                    else {
                        System.out.print("  ");
                        }
                }
                System.out.println();
            }

        }


.........................................................................
OUTPUT:

* * * * * * * * * 
*               * 
*               * 
*               * 
* * * * * * * * * 
                * 
                * 
                * 
                * 

&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;private static void pattern10() {

            for(int row=1;row&amp;lt;=9;row++) {
                for(int col=1;col&amp;lt;=9;col++) {
                    if(col==1||col==4|| col==9|| row==1&amp;amp;&amp;amp;col&amp;gt;=4|| row==9&amp;amp;&amp;amp;col&amp;gt;=4) {
                        System.out.print("* ");
                    }
                    else {
                        System.out.print("  ");
                        }
                }
                System.out.println();
            }

        }   
.........................................................................
OUTPUT:

*     * * * * * * 
*     *         * 
*     *         * 
*     *         * 
*     *         * 
*     *         * 
*     *         * 
*     *         * 
*     * * * * * * 

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Java Programs for Alphabet And Pattern Printing</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Wed, 12 Feb 2025 15:56:28 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/java-programs-for-alphabet-and-pattern-printing-3bj2</link>
      <guid>https://dev.to/guna_sekaran_/java-programs-for-alphabet-and-pattern-printing-3bj2</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  package ifelse;

public class Patter_n {
    public static void main(String[] args) {

        pattern_x();

    }
    public static void pattern_x() 
    {
            for(int row=1;row&amp;lt;=9;row++)
            {
                for(int col=1;col&amp;lt;=9;col++)
                {
                    if(row==col || row+col==10) {
                        System.out.print("* ");
                    }
                    else {
                        System.out.print("  ");
                    }

                }

                System.out.println();

            }
    }  

.........................................................................

   OUTPUT:

 *              * 
  *           *   
    *       *     
      *   *       
        *         
      *   *       
    *       *     
  *           *   
*               * 



&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;package ifelse;

public class Patter_n {
    public static void main(String[] args) {

//      pattern_x();
        pattern();

    }
    private static void pattern() {
        // TODO Auto-generated method stub
        for(int row=1;row&amp;lt;=9;row++)
        {
            for(int col=1;col&amp;lt;=9;col++) {

                if(col==1 ||col==9 ||row==col || row+col==10) {
                    System.out.print("* ");
                    }
                else {
                    System.out.print("  ");
                }
                }

                System.out.println();   

        }
        }

.........................................................................

OUTPUT:
*               * 
* *           * * 
*   *       *   * 
*     *   *     * 
*       *       * 
*     *   *     * 
*   *       *   * 
* *           * * 
*               * 


&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;package ifelse;

public class Patter_n {
    public static void main(String[] args) {

//      pattern_x();
        pattern();

    }
    private static void pattern() {
        // TODO Auto-generated method stub
        for(int row=1;row&amp;lt;=9;row++)
        {
            for(int col=1;col&amp;lt;=9;col++) {

                if( col==5 ||row==5 ||row==col || row+col==10) {
                    System.out.print("* ");
                    }
                else {
                    System.out.print("  ");
                }
                }

                System.out.println();   

        }
}

.........................................................................

OUTPUT:

*       *       * 
  *     *     *   
    *   *   *     
      * * *       
* * * * * * * * * 
      * * *       
    *   *   *     
  *     *     *   
*       *       * 

&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;package ifelse;

public class Patter_n {
    public static void main(String[] args) {

//      pattern_x();
//      pattern();
        pattern_c();


    }
    private static void pattern_c() {
        // TODO Auto-generated method stub



        for(int row=1;row&amp;lt;=9;row++)
        {
            for(int col=1;col&amp;lt;=9;col++) {

                if(col==1 ||row==1 ||row==9 ) {
                    System.out.print("* ");
                    }
                else {
                    System.out.print("  ");
                }
                }

                System.out.println();   

        }



    }

.........................................................................
   OUTPUT:
* * * * * * * * * 
*                 
*                 
*                 
*                 
*                 
*                 
*                 
* * * * * * * * * 

&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;package ifelse;

public class Patter_n {
    public static void main(String[] args) {

//      pattern_x();
//      pattern();
        pattern_c();


    }
    private static void pattern_c() {
        // TODO Auto-generated method stub



        for(int row=1;row&amp;lt;=9;row++)
        {
            for(int col=1;col&amp;lt;=9;col++) {

                if(col==5||row==1 ||row==9 ) {
                    System.out.print("* ");
                    }
                else {
                    System.out.print("  ");
                }
                }

                System.out.println();   

        }



    }
.........................................................................
    OUTPUT:
* * * * * * * * * 
        *         
        *         
        *         
        *         
        *         
        *         
        *         
* * * * * * * * * 

&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;
public class Patter_n {
    public static void main(String[] args) {

//      pattern_x();
//      pattern();
        pattern_c();


    }
    private static void pattern_c() {
        // TODO Auto-generated method stub



        for(int row=1;row&amp;lt;=9;row++)
        {
            for(int col=1;col&amp;lt;=9;col++) {

                if(col==1 ||col==9 ||row==col ) {
                    System.out.print("* ");
                    }
                else {
                    System.out.print("  ");
                }
                }

                System.out.println();   

        }



    }
.........................................................................
      OUTPUT:
*               * 
* *             * 
*   *           * 
*     *         * 
*       *       * 
*         *     * 
*           *   * 
*             * * 
*               * 

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>LCM AND GCD PROGRAM IN JAVA.</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Mon, 10 Feb 2025 16:22:07 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/lcm-and-gcd-program-in-java-3317</link>
      <guid>https://dev.to/guna_sekaran_/lcm-and-gcd-program-in-java-3317</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      FINDING LCM:


package ifelse;

public class Lcm {
    public static void main(String[] args) {
        int no1=2;
        int no2=4;
        int big=0
        if(no1&amp;gt;no2) 
            big=no1;
        else
            big=no2;
    while(true) {

        if (big%no1==0 &amp;amp;&amp;amp; big%no2==0);
        System.out.println("LCM IS:"+big);
        break;


    }
    big++;  

    }

}

   OUTPUT:
       LCM IS:4
&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;package ifelse;

public class Lcm {
    public static void main(String[] args) {
        int no1=2;
        int no2=4;
        int big=0;
        int limit=0;
        if (no1 &amp;gt; no2) {
            big = no1;
        } else {
            big = no2;
        }

       while(big&amp;lt;100) {

        if (big%no1==0 &amp;amp;&amp;amp; big%no2==0)
        System.out.println("LCM IS:"+big);


        big++;      
    }


}

}



OUTPUT:
LCM IS:4
LCM IS:8
LCM IS:12
LCM IS:16
LCM IS:20
LCM IS:24
LCM IS:28
LCM IS:32
LCM IS:36
LCM IS:40
LCM IS:44
LCM IS:48
LCM IS:52
LCM IS:56
LCM IS:60
LCM IS:64
LCM IS:68
LCM IS:72
LCM IS:76
LCM IS:80
LCM IS:84
LCM IS:88
LCM IS:92
LCM IS:96

&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;
 FINDING GCD:


package ifelse;

public class Gcd {
    public static void main(String[] args) {


    int no1=1000;
    int no2=500;

    int div=1;
  while (div &amp;lt; no1 &amp;amp;&amp;amp; div &amp;lt; no2) {
      if(no1%div==0 &amp;amp;&amp;amp; no2%div==0)
      System.out.println("GCD IS:"+div);
      div++;

  }
}
}

    OUTPUT:
       GCD IS:1
GCD IS:2
GCD IS:4
GCD IS:5
GCD IS:10
GCD IS:20
GCD IS:25
GCD IS:50
GCD IS:100
GCD IS:125
GCD IS:250


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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Mastering Special Numbers in Java: Prime, Emirp, Perfect, Neon, and Strong Numbers .</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Thu, 06 Feb 2025 17:03:59 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/mastering-special-numbers-in-java-prime-emirp-perfect-neon-and-strong-numbers-explained-2mic</link>
      <guid>https://dev.to/guna_sekaran_/mastering-special-numbers-in-java-prime-emirp-perfect-neon-and-strong-numbers-explained-2mic</guid>
      <description>&lt;p&gt;STRONG NUMBERS:&lt;br&gt;
      A Strong Number is a number in which the sum of the factorials of its digits is equal to the original number itself.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
145 is a Strong Number because:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   1!+4!+5!=1+24+120=145
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;PERFECT NUMBER: &lt;br&gt;
     A Perfect Number is a positive integer that is equal to the sum of its proper divisors including itself.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example:
 Proper divisors of 28 = 1, 2, 4, 7, 14
 Sum of divisors:1+2+4+7+14=28
 Since 28 == 28, it is a Perfect Number.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Another example: 6&lt;br&gt;
    Proper divisors: 1, 2, 3&lt;br&gt;
    Sum: 1+2+3=6&lt;br&gt;
    6 is a Perfect Number.&lt;/p&gt;

&lt;p&gt;NEON NUMBER:&lt;br&gt;
   A Neon Number is a number where the sum of the digits of its square is equal to the original number.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example:9

Square the number:92=81
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Sum of the digits of the square:&lt;br&gt;
    8+1=9&lt;br&gt;
   Since 9 == 9, it is a Neon Number.&lt;/p&gt;

&lt;p&gt;PRIME NUMBER:&lt;br&gt;
   A Prime Number is a number greater than 1 that is only divisible by 1 and itself.&lt;/p&gt;

&lt;p&gt;Example: &lt;br&gt;
   Prime Numbers: 2, 3, 5, 7, 11, 13, 17.&lt;/p&gt;

&lt;p&gt;EMIRP NUMBER:&lt;br&gt;
      An Emirp Number is a prime number that remains prime even when its digits are reversed.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Example:13
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;13 is prime number because it is a of Factors: 1, 13&lt;br&gt;
 After its been Reversed of 13 = 31&lt;br&gt;
 it remains in the prime number.&lt;br&gt;
 Since both 13 and 31 are prime, 13 is an Emirp Number. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Nested while loop in java</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Wed, 05 Feb 2025 16:30:01 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/nested-while-loop-in-java-2321</link>
      <guid>https://dev.to/guna_sekaran_/nested-while-loop-in-java-2321</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package ifelse;

public class Task1 {
     public static void main(String[] args) {

      int row = 5;
      int colum = 5;
      int a = 0;
   while (a &amp;lt; row) {
    int b = 0;
    while (b &amp;lt; colum) {
      if ((a + b) % 2 == 0) {
         System.out.print("1 ");
    }
    else 
    {
         System.out.print("0 ");
            }
     b++;

           }
         System.out.println();
            a++;

                 }
             }




    }

   OUTPUT:
        1 0 1 0 1 
        0 1 0 1 0 
        1 0 1 0 1 
        0 1 0 1 0 
        1 0 1 0 1 

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

&lt;/div&gt;



</description>
      <category>java</category>
    </item>
    <item>
      <title>while loop in java</title>
      <dc:creator>Guna Sekaran</dc:creator>
      <pubDate>Tue, 04 Feb 2025 14:27:14 +0000</pubDate>
      <link>https://dev.to/guna_sekaran_/while-loop-in-java-41hl</link>
      <guid>https://dev.to/guna_sekaran_/while-loop-in-java-41hl</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package ifelse;

public class Thenaliraman {
   public static void main(String[] args) {
    int whip_bit=1024;
    int count=0;
while(whip_bit&amp;gt;1) {
    whip_bit=whip_bit/2;
    count++;
    System.out.println( whip_bit);

}
System.out.println("total person:" + count);

}
}

//output:
512
256
128
64
32
16
8
4
2
1
total person:10







&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;package ifelse;
public class Number {
    public static void main(String[] args) {
        int a = 3;
        int count = 1;

        while (count &amp;lt;= 10) {
            int b =count * a;
            System.out.println(count + " * " + a + " = " +b);
            count=count+1;
        }
    }
}

output:
   1 * 3 = 3
2 * 3 = 6
3 * 3 = 9
4 * 3 = 12
5 * 3 = 15
6 * 3 = 18
7 * 3 = 21
8 * 3 = 24
9 * 3 = 27
10 * 3 = 30


&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;package ifelse;

public class Number1 {
    public static void main(String[] args) {
        int a=100;
        int b=120;
        int count=1;
    while(count&amp;lt;=a &amp;amp;&amp;amp; count&amp;lt;=b) {
        if(a%count==0 &amp;amp;&amp;amp; b%count==0) {
        System.out.println("common divisible numbers:"+ count);
        }
        count++;
    }
    }


    }


     output:

          common divisible numbers:1
          common divisible numbers:2
          common divisible numbers:4
          common divisible numbers:5
          common divisible numbers:10
          common divisible numbers:20


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

&lt;/div&gt;



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