Wednesday, 13 May 2020

Print all the String elements using DDA

Write a program to input and store String elements in a double dimensional array of size  3 x 4  and Print all the String elements.

import java.util.*;

class  DD
{
    public static void main(String arg[])
    {
        String[][]  nm = new String[3][4];
                 
        Scanner sk = new Scanner(System.in); 
    
        System.out.println("Enter the names  ");
        
        for(int i=0 ; i<3 ; i++)
        {
            for(int j=0 ; j<4 ; j++)
            {
                nm[i][j] = sk.nextLine();
            }
        }
        
        System.out.println("The output is : ") ; 
        
        for(int i=0 ; i<3 ; i++)
        {
            for(int j=0 ; j<4 ; j++)
            {
               System.out.print(nm[i][j] + "  ") ;  
            }
            System.out.println() ; 
        }          
    
    }
}

=================================================

Subscribe and Share my Blog and YouTube channel 

Blog : www.definecompute.blogspot.com

YouTube  :  SK Skill India 

================================================





Find the sum of diagonal elements in Java

Write a program to input and store integer elements in a double dimensional array of size  3 x 3  and find the sum of diagonal elements. 

import java.util.*;

class DDA
{
    public static void main(String arg[])
    {
        int[][] num = new int[3][3];
       
        int x = 0 ;
       
        Scanner sk = new Scanner(System.in);
   
        System.out.println("Enter all the values ");
       
        for(int i=0 ; i<3 ; i++)
        {
            for(int j=0 ; j<3 ; j++)
            {
                num[i][j] = sk.nextInt();
            }
        }
       
        x = num[0][0] + num[1][1] + num[2][2] + num[0][2] + num[2][0] ; 
       
        System.out.println("The sum of the diagonal elements is : " +x) ;
   
    }
}

====================================================

Search my YouTube channel   :    SK Skill India 

====================================================








Find the sum of all the elements in DDA


Write a program to input and store integer elements in a double dimensional array of size  3 x 4  and find the sum of all the elements.

import java.util.*;

class DDA
{
    public static void main(String arg[])
    {
        int[][] num = new int[3][4];
       
        int x = 0 ;
       
        Scanner sk = new Scanner(System.in);
   
        System.out.println("Enter all the values ");
       
        for(int i=0 ; i<3 ; i++)
        {
            for(int j=0 ; j<4 ; j++)
            {
                num[i][j] = sk.nextInt();
            }
        }
       
        for(int i=0 ; i<3 ; i++)
        {
            for(int j=0 ; j<4 ; j++)
            {
                x = x + num[i][j] ;
            }
        }   
       
        System.out.println("The sum of all the elements is : " +x) ;
   
    }
}



Tuesday, 12 May 2020

Print all the integer elements in DDA

Write a program to input and store integer elements in a double dimensional array of size  3 x 4  and Print all the integer elements.


                                               // User Defined
import java.util.*;
class  DDA
{
    public static void main(String args[])
    {
        int[][] num = new int[3][4];
        Scanner sk=new Scanner(System.in) ;         
        System.out.println("Enter ur Value :") ;   
      
        // This loop is used to store the values in the array index 

        for(int i=0 ; i<3 ; i++)                     //Row
        {
            for(int j=0 ; j<4 ; j++)                // Column
            {
                num[i][j] = sk.nextInt();
            }         
        }     
 
         System.out.println(" The output is  :") ;        

        for(int i=0 ; i<3 ; i++)
        {
            for(int j=0 ; j<4 ; j++)
            {
                System.out.print(num[i][j] + "  ");      // Use print instead of println
            }                 //use double quotation for space between each number   

            System.out.println();             // This println() is use to change of row
        }           
    }
}


======================================================

Subscribe my YouTube channel  :   SK Skill India 

======================================================










Basic concept of Double Dimensional Array


Double Dimensional arrays is consists of two subscripts : one for the row and other for the column. 
The first subscript is always the row subscript and second is column subscript.   

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

        int[][] A = new int[2][3] ;
        A[0][1] = 11 ;
        A[0][1] = 22 ;
        A[0][2] = 33 ;
        A[1][0] = 44 ;
        A[1][1] = 55 ;
        A[1][2] = 66 ;           
        System.out.println(" The value is " + A[0][2]) ;
        System.out.println(" The value is " + A[1][1]) ;
    }
}                     
==========================================================

// Two Dimensional arrays is consists of two subscripts : one for the row and other for the column. 

class  DDA
{
    public static void main(String args[])
    {
        int[][] A = {{10,20,30} , {40,50,60}};         
        System.out.println(" The value is " + A[0][2]) ;
        System.out.println(" The value is " + A[1][1]) ;
    }
} 

======================================================

Subscribe my YouTube channel  :  SK Skill India 

=======================================================








Array User Defined Part 2

 /* Write a program that creates an integer array of 10 elements, accepts 10 different values from the user and displays the value  . */     

import java.util.*;
class  Arr
{
    public static void main(String args[])
    {
       int[] a = new int[10] ;
       Scanner sk=new Scanner(System.in);       
       System.out.println(" Enter 10 different number : ") ;             
       for(int i=0 ; i<a.length ; i++)
       {   
            int num = sk.nextInt(); 
            a[i] = num ; 
       }      
       for(int i=0 ; i<a.length ; i++)
       {
            System.out.println(" Element " +a[i]) ;
       }
    }
}



Basic concept of Array in Java Program Part 1


 An Array is a group of like-typed variables that are referenced by a common name. 
                                                      OR
 An Array is the collection of Homogeneous or Similar data-type. 

Example 1
                                  // Use of integer in array 
class Array
{
    public static void main(String args[])
    {
        int[] A = new int[5] ;
        A[0] = 7 ;
        A[1] = 2 ;
        A[2] = 3 ;
        A[3] = 1 ;
        A[4] = 5 ;   
        System.out.println(" The value is " + A[2]) ;
        System.out.println(" The value is " + A[4]) ;
    }
}
=====================================================
Example 2
                                                // Addition in Array
class Array
{
    public static void main(String args[])
    {
        int[] A = new int[5] ;
        A[0] = 7 ;
        A[1] = 2 ;
        A[2] = 3 ;
        A[3] = 1 ;
        A[4] = 5 ;   
        int x = A[1] + A[4] ;        
        System.out.println(" The value is " + x) ;      
    }
}
====================================================
Example 3
                                       // Use of String in array 
class Array
{
    public static void main(String args[])
    {
        String d[] = {"Mon" , "Tue" , "Wed" , "Thurs" , "Fri" , "Sat"} ;       
        System.out.println(d[0]) ;
        System.out.println(d[2]) ;
    }
}



Friday, 1 May 2020

Algorithm and Flowchart



Algorithm

Algorithm is the step by step instructions written in simple language to perform a particular task .

Example : Write an algorithm to find the addition of Two number 
                 
Answer  :    Step 1 : Start 
                   Step 2 : Take N1 , N2 
                   Step 3 : sum = N1 + N2 
                   Step 4 : Print sum 
                   Step 5 : Stop 


Flowchart

Flowchart is a step by step process of representing the solution of a particular problem in a graphical or pictorial form.



Example :    






Follow my YouTube channel   :   SK Skill India 








Thursday, 30 April 2020

Microsoft word



What is MS Word?
                MS Word is a word processor software that help you to create editing , typing , text ,
                formatting and save document.
                MS Word enables you to information in the form of a list or points using bullet and
                numbering option.


Advantage of MS Word?
   (i)      We can type text in MS word.
   (ii)     We can edit whole or a part of the text.
   (iii)    We can print whole or a part of the text.
   (iv)    We can check spelling & grammar also. 
   (v)     We can use Header & Footer also.


How to Start MS Word?
                (I)    Start
   (II)    All Program
   (III)  Microsoft office
   (IV)  Microsoft office word


































Subscribe my YouTube channel  :  SK Skill India
















Neon number in Java


Neon number is a number where the sum of digits of square of the number is equal to that number.
                   Example :  n=9  , p = 9 * 9 = 81   , s = 8+1 = 9   (n = s , it is neon number)

import java.util.*;
class  Neon
{
    public static void main(String[] args)
    {
        int  rem ;   int  s = 0;

        Scanner sk = new Scanner(System.in);
        System.out.print("Enter number: ");
        int n = sk.nextInt();
         
        int p = n * n ;
    
        while (p != 0)
        {
            rem = p % 10;
            s = s + rem;
            p = p / 10;
        }

        if (n == s)
        {
            System.out.println(" Neon number ");
        }
        else
        {
            System.out.println(" Not a Neon number ");
        }
    }
}

================================================================


Subscribe my YouTube channel :  SK Skill India



Tuesday, 28 April 2020

HTML Element and Usage


                                HTML  Element  and  Usage                       
                                B             = Bold
                                U             = UnderLine
                                S              = StrikeThrough
                                 I              = Italic
                                SUB        = Subscript
                                SUP        = Superscript
                                H1           = Heading 1
                                H6           = Heading 6
                                Head     = To start Heading section
                                Title       = To change the web page title
                                Body      = To start Body section
                                Table     = For creating table
                                TD           = Table Data
                                TR           = Table Row
                                TH           = Table Header
                                HR          = Horizontal Line
                                BR           = Break Line
                                LI             = List Item
                                Font       = Change Font size
                                P             = Change Paragraph
                                IMG       = Inserting Image                            
                                OL           = Order List
                                UL           = Unorder List                                    
                                Script     = To add script (Javascript , Vbscript) to page
                                Style      = To add stylesheet to page
                                A             = Hyperlink
                                HREF      = Hyper Reference
                                Face       = To Change Font Style
                                PRE        = To contain space
                                ALT         = AlternateText
                                coords  = Coordinates
                                SRC        = Source
                                DL           = Data List
                                DT           = Data Terms
                                DD          = Data Description
        Frame      = To Insert content for a window
                                FrameSet   = To Divide pages into window 
                                Marquee    = For scrolling text