Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the relational operator of C #

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use the relational operator of C #". The content of the explanation in the article is simple and clear, and it is easy to learn and understand. Let's follow the editor's train of thought to study and learn how to use the relational operator of C#.

Example

Take a look at the following example for all the relational operators available in C#:

Using System

Class Program

{

Static void Main (string [] args)

{

Int a = 21

Int b = 10

If (a = = b)

{

Console.WriteLine ("Line 1-an equals b")

}

Else

{

Console.WriteLine ("Line 1-an is not equal to b")

}

If (a b)

{

Console.WriteLine ("Line 3-an is greater than b")

}

Else

{

Console.WriteLine ("Line 3-an is not greater than b")

}

/ * change the values of an and b * /

A = 5

B = 20

If (a = a)

{

Console.WriteLine ("Line 5-b is greater than or equal to a")

}

}

}

When the above code is compiled and executed, it produces the following results:

Line 1-an is not equal to bLine 2-a not less than bLine 3-a greater than bLine 4-a less than or equal to bLine 5-b greater than or equal to a thank you for reading, the above is the "C # relational operator how to use" the content, after the study of this article, I believe that you have a deeper understanding of how to use the relational operator of C#, the specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report