C
C#3y ago
4

How can I print backwards the numbers I get as a result? [Answered]

I can't use the numbers I got at the end again
12 Replies
Becquerel
Becquerel3y ago
foreach (var number in massive.Reverse())
{
Console.WriteLine(number);
}
foreach (var number in massive.Reverse())
{
Console.WriteLine(number);
}
you will need to add using System.Linq;
sunder.cc
sunder.cc3y ago
or you can simply use a reversed for loop
for (int i = massive.Length - 1; i >= 0; i--)
{
Console.WriteLine(massive[i]);
}
for (int i = massive.Length - 1; i >= 0; i--)
{
Console.WriteLine(massive[i]);
}
4
4OP3y ago
this is my homework i have to write this without using reverse
Becquerel
Becquerel3y ago
PepeHands that case use a reverse for-loop
4
4OP3y ago
I understand how to write, thank you very much
4
4OP3y ago
how u write message like this ?
sunder.cc
sunder.cc3y ago
3 backticks at the start, then the language and end with backticks ```cs ```
MODiX
MODiX3y ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat If your code is too long, post it to: https://paste.mod.gg/
4
4OP3y ago

Console.WriteLine("Thank you for teaching me these !");

Console.WriteLine("Thank you for teaching me these !");
4
4OP3y ago
Console.WriteLine("OMG its works !");
Console.WriteLine("OMG its works !");
Accord
Accord3y ago
✅ This post has been marked as answered!
Want results from more Discord servers?
Add your server