Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8770091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:29:23+00:00 2026-06-13T17:29:23+00:00

I have created a matrix in java using only loops. But I wanted to

  • 0

I have created a matrix in java using only loops. But I wanted to show the total of the row at the end. I have been trying to figure this out and I cannot come up with a solution. Any help would be appreciated.

This is the code I have so far

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

        int num = 4;
        int product = 0;

        for (int i = 1; i <= num; i++) {

            for (int j = 1; j <= num; j++) {

                 product = j * i;

                System.out.printf("\t" + product);


            }

            System.out.println();
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:29:25+00:00Added an answer on June 13, 2026 at 5:29 pm

    If I understand you correctly, you just need to implement something such as: int total = 0; then on each cycle of the loop update accordingly…total = total + x;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a sparse matrix using MEX and also created a sparse matrix
I have created a 2D matrix like this: 45 67 Row Fine 25 22
Hello, I have created a multithreaded application for multiplying two matrices using pthreads,but to
I have created the following type using implicit type construction: open System type Matrix(sourceMatrix:double[,])
I have created an EDMX in visual studio 2010 SP1. It has been built
I have created an android application that calls (using kSOAP library) a SOAP based
I have created a SSRS 2008 report.I have created a matrix.I want to make
i have created a coverflow using the code given by http://android.jmsliu.com/138/android-infinite-loop-gallery.html . And it
I have a small open GL application I'm writing in Java using JOGL. I'm
I have created a 2x2 matrix of 2x2 matrices: a = matrix([[matrix([[ 1, 2],

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.