Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Generate Multiples | Functions Returning Arrays & Refactoring Loops
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Methods & Modular Thinking

bookChallenge: Generate Multiples

Opgave

Swipe to start coding

Write a method that returns an array of multiples of a given number up to a specified limit.

  • The method must return an array containing all multiples of number that are less than or equal to limit.
  • If number is zero or greater than limit, the method must return an empty array.
  • The array must contain the multiples in ascending order, starting from number up to the largest multiple not exceeding limit.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 2
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you give me a real-world example?

close

bookChallenge: Generate Multiples

Stryg for at vise menuen

Opgave

Swipe to start coding

Write a method that returns an array of multiples of a given number up to a specified limit.

  • The method must return an array containing all multiples of number that are less than or equal to limit.
  • If number is zero or greater than limit, the method must return an empty array.
  • The array must contain the multiples in ascending order, starting from number up to the largest multiple not exceeding limit.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 2
single

single

some-alt