- 1

How to Output Multiple of 3? C#

I want to make so that it prints out numbers and replace multiple of 3 whit: *. I am working whit C# and i am just a beginer of this new world.

20th May 2021, 7:14 PM
Neza22
Neza22 - avatar
4 Respuestas
+ 6
use modulo operator (%) to compute rest of division by 3: if it equals zero, then it is divisible by 3...
20th May 2021, 7:17 PM
visph
visph - avatar
+ 4
For better help post your code
20th May 2021, 7:21 PM
Atul [Inactive]
+ 2
Maybe you can use loop.
21st May 2021, 8:22 AM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 2
Muhd Khairul Amirin It is to be used. Or can be done through recursion also
21st May 2021, 8:25 AM
Atul [Inactive]