Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Reverse Words in a Sentence | Advanced Looping: Patterns, Nesting, and Pitfalls
Quizzes & Challenges
Quizzes
Challenges
/
C# Loops Practice

bookChallenge: Reverse Words in a Sentence

Opgave

Swipe to start coding

Write a function that reverses the order of words in a given sentence using a loop.

  • The function must split the input sentence into words.
  • The function must use a loop to reconstruct the sentence with the words in reverse order.
  • The function must return the reversed sentence as a single string.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 4
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

close

Awesome!

Completion rate improved to 5.56

bookChallenge: Reverse Words in a Sentence

Stryg for at vise menuen

Opgave

Swipe to start coding

Write a function that reverses the order of words in a given sentence using a loop.

  • The function must split the input sentence into words.
  • The function must use a loop to reconstruct the sentence with the words in reverse order.
  • The function must return the reversed sentence as a single string.

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 3. Kapitel 4
single

single

some-alt