Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Matrix Sum | Working with 2D Arrays
Quizzes & Challenges
Quizzes
Challenges
/
C# Arrays

bookChallenge: Matrix Sum

Tâche

Swipe to start coding

Write a program that calculates the sum of all elements in a 2D integer array and prints the result.

  • Iterate through each row of the matrix parameter.
  • For each row, iterate through each column.
  • Add each element to a running total.
  • Return the total sum.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 4
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Matrix Sum

Glissez pour afficher le menu

Tâche

Swipe to start coding

Write a program that calculates the sum of all elements in a 2D integer array and prints the result.

  • Iterate through each row of the matrix parameter.
  • For each row, iterate through each column.
  • Add each element to a running total.
  • Return the total sum.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 4
single

single

some-alt