C
C#11mo ago
3omar

C# is it possible to show all the digits instead of what is divisible by 8 ?

No description
6 Replies
Joschi
Joschi11mo ago
Your code consists out of 3 basic parts. A for loop, a if condition and the print statement. Do you understand what each of those is doing exactly?
Angius
Angius11mo ago
You could add an else
3omar
3omarOP11mo ago
Yes, To start with 1 and ends with 200, next to each number that is divisible by 8, print "Good"
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
3omar
3omarOP11mo ago
Thanks, it worked
Joschi
Joschi11mo ago
Ok great! Now you want to print each number. The naive way would be to just add a new print statement somewhere in the loop, but outside the if. If you do that you will notice a new problem. Your divisible by 8 once will be printed twice right? To solve that you can use an else
Want results from more Discord servers?
Add your server