[Note] C # basic introduction -- Comparison operators of C,

Source: Internet
Author: User

[Note] C # basic introduction -- Comparison operators of C,

The comparison operator is used to compare the number size or compare equal numbers. Comparison operators in C # include:

= Equal
! = Not equal
> Greater
< Less
> = Greater than or equal
<= Less than or equal

Note: "equal" indicates that two equal values are composed of two "=.

 

The result of the comparison operation is boolean. bool indicates true (true) and false (not true) in logic ). True and false are represented by the true and false keywords.

 

Namespace Test {class Program {static void Main (string [] args) {int x = 5; int y = 6; Console. writeLine (x> = y); Console. writeLine (x <= y );}}}

In the above program, if x> = y is not true, false is returned. If x <= y is true, true is returned. Running result:

The above is taken from MOOC course C # getting started with development

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.