Hyderabad Local Train Timings   Andhra Tourist Spots   Telangana Issue - SriKrishna Committee   APPSC Exams Online Guide   
AndhraSpider.com
 
 


ForumResourcesTolly UpdatesEntrance ExamsQuestion Bank



My Profile


Active Members
Today
    Last 7 Daysmore...



    Resources » Education » Andhra Pradesh school/colleges/university news


    JNTU Hyderabad CSE/IT Java OOPS Week 2B - Multiplication of Two Matrices


    Posted Date:     Category: Andhra Pradesh school/colleges/university news    Rating: 2 out of 52 out of 5
    Author: Member Level: Gold    Points: 5 (Rs 2)


    Are you looking for JNTU Hyderabad CSE/IT solved java 2-2 lab assignments and week programs ? Here is the perfect resource for you . You can directly copy and paste the below code in a Java Editor to excecute the program.


    Get the solutions for JNTU Btech Lab java programs for CSE and Information Technology branches . The resource includes the clear explanation of the code. The below code was uploaded only after the successful execution using Java Standard Edition. JNTU Hyderabad and affiliated colleges conducts a lab session every week for all B.tech Regular students. Here I'm giving solution for the Week 2 2nd program. The aim of the program is to find multiply the two matrices using a simple java program .You can also get more information about JNTU Java programs solutions on this site for all weeks.
    Input: The elements of two 2X2 matrices are given as input.
    This can be solved in java by implementing the following source code. With this, you have successfully completed
    the week 2 second program of your Jntu CSE/IT 2-2 Syllabus.
    //To multiply two matrices and store the result in 3rd matrix
    class Mat//define class
    {
    public static void main(String args[])
    {
    int j,l=0,i;//declare some useful variables
    int a[][]=new int[2][2];//create matrix a
    int b[][]= new int[2][2];//create matrix b
    for(i=0;i<2;i++)//for i=1,2
    for(j=0;j<2;j++)//for j=1,2
    a[i][j]=Integer.parseInt(args[l++]);//read the elements of a
    for(i=0;i<2;i++)//for i=1,2
    for(j=0;j<2;j++)//for j=1,2
    b[i][j]=Integer.parseInt(args[l++]);//read the elements of a
    for( i=0;i<2;i++)//for i=1,2
    for( j=0;j<2;j++)//for j=1,2
    {
    int c[][]={{0,0},{0,0}};//initialise matrix c
    for(int k=0;k<2;k++)//for k=1,2
    {
    c[i][j]=c[i][j]+(a[i][k]*b[k][j]); //calculate the product and store in c
    }
    System.out.println(c[i][j]);//display matrix c
    }

    }
    }

    The output will be as follows:
    Output:
    D:\education\java\programs>javac Matrix.java
    D:\education\java\programs>java Matrix 1 2 3 4 1 2 3 4
    Resultant matrix is
    7
    10
    15
    22


    Did you like this resource? Share it with your friends and show your love!




    Related Resources:


    Read related articles: JNTU Hyderabad    JNTU lab assignments    


    Responses to "JNTU Hyderabad CSE/IT Java OOPS Week 2B - Multiplication of Two Matrices"

    No responses found. Be the first to respond...

    Feedbacks      

    Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: JNTU Hyderabad CSE/IT Java OOPS Week 2A - To find the prime numbers below 'n'
    Previous Resource: List of Courses for the Students after SSC or 10th Class & Guide to Students
    Return to Resources
    Post New Resource
    Category: Andhra Pradesh school/colleges/university news


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Jntu week programs  .  Lab programs  .  Java programs  .  Week programs  .  Jntu Hyderabad  .  

    Subscribe to Email
  • Get Jobs by Email
  • Forum posts by Email
  • Articles by Email

  • Skilled Writer?

    Part time content writers wanted for several websites to work online from home.
    Skills: Excellent English writing skills. Good English skills with basic computing knowledge needed. Visit the link below for more details

    Online Content Writing Jobs

    Online membersMore...


    Areas
  • Adilabad
  • Anantapur
  • Chittoor
  • Cuddapah
  • East Godavari
  • Guntur
  • Hyderabad
  • Karim Nagar
  • Khammam
  • Krishna
  • Kurnool
  • Mahabub Nagar
  • Medak
  • Nalgonda
  • Nellore
  • Nizamabad
  • Prakasam
  • Ranga Reddy
  • Rangareddy
  • Srikakulam
  • Visakhapatnam
  • Vizianagaram
  • Warangal
  • West Godavari

  • Awards & Gifts



    About Us    Contact Us    Copyright    Privacy Policy    Terms Of Use    Revenue Sharing sites   Advertise   Talk to Tony John
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2011 All Rights Reserved.