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 Go language

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

Share

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

Most people do not understand the knowledge points of this article "how to use the relational operator of the Go language", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use the relational operator of the Go language" article.

Example

Package main

Import "fmt"

Func main () {

Var an int = 21

Var b int = 10

If (a = = b) {

Fmt.Printf ("the first line-an equals b\ n")

} else {

Fmt.Printf ("the first line-an is not equal to b\ n")

}

If (a)

< b ) { fmt.Printf("第二行 - a 小于 b\n" ) } else { fmt.Printf("第二行 - a 不小于 b\n" ) } if ( a >

B) {

Fmt.Printf ("the third line-an is greater than b\ n")

} else {

Fmt.Printf ("the third line-an is not greater than b\ n")

}

/ * Lets change value of an and b * /

A = 5

B = 20

If (a = a) {

Fmt.Printf ("Line 5-b is greater than or equal to a\ n")

}

}

The running result of the above instance:

The first line-an is not equal to b second line-an is not less than b third line-an is greater than b fourth line-a less than or equal to b fifth line-b greater than or equal to an is about the content of this article "how to use the relational operator of Go language", I believe everyone has a certain understanding, I hope the content shared by the editor will be helpful to you, if you want to know more about the relevant knowledge Please follow the industry information channel.

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