chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


[C#] Even number filter_list
Author
Message
[C#] Even number #1
Hello,
When you want to see if a numer is even in C# we use the code:

Code:
( x % 2 == 0)

But why is that? I don't see any logic explanation behind it?
As long as you are living, you will face problems. But you serve a God who solves problems.

Reply

RE: [C#] Even number #2
EDIT: Wrong explanation.

Actually modulo gives you the remainder when you divide. The result of an odd number when halved is 1 and while even numbers are 0.
(This post was last modified: 07-26-2019, 01:34 AM by OversouL.)
[Image: dHJ4Beo.gif]
Hidden Lesson: Reactions are always instinctive whereas responses are always well thought of.

Reply

RE: [C#] Even number #3
Is this for making a program in C?
My IT skills that I know perfect is SQL, HTML ,css ,wordpress, PHP.
coding skills that I know is Java, JavaScript and C#

Reply

RE: [C#] Even number #4
(07-26-2019, 06:45 AM)darkninja1980 Wrote: Is this for making a program in C?
C#, its in the title
[Image: SOs4uYN.png]
(This post was last modified: 07-26-2019, 07:10 AM by Spore.)
COM1 Serial User.

Reply

RE: [C#] Even number #5
(07-26-2019, 07:09 AM)Spore Wrote:
(07-26-2019, 06:45 AM)darkninja1980 Wrote: Is this for making a program in C?
C#, its in the title
[Image: SOs4uYN.png]
What I mean is he can show the whole source code.
My IT skills that I know perfect is SQL, HTML ,css ,wordpress, PHP.
coding skills that I know is Java, JavaScript and C#

Reply

RE: [C#] Even number #6
Code:
x % 2
gives the remainder after the integer division (when dealing with only integers such as in this case, otherwise a common type) of x/2. The % is called the modulo operator. Of course when the remainder is 0, the number is even.
Source


Ransomware is more about manipulating vulnerabilities in human psychology than the adversary’s technological sophistication.

Reply






Users browsing this thread: 1 Guest(s)