In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to use three conditional judgment sentences in C language". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
If statement
In the if statement, you first judge the value of the expression, and then control the program flow according to the condition of that value. It is true if the value of the expression is not equal to 0; otherwise, it is false. There are three forms of if statement: if,if--else and else if.
If (expression) statement if (expression) {statement block 1;} else {statement block 2;} if (expression 1) statement 1else if (expression 2) statement 2 (expression 2) statement 2. Else if (expression 1) statement n-1else statement nested form if (expression 1) {if (expression 2) {statement block 1 } else {statement block 2;} {else {if (expression 3) {statement block 3;} else {statement block 4;}} conditional operator
The conditional operator can check whether the value of an expression is true or false, and then return one of the other two expressions based on the test result.
Expression 1? Expression 2: expression 3 * * max = (a > b)? aVue b
In the operation, the value of the first expression is checked first. If the value is true, the result value of the second expression is returned; if false, the result value of the third expression is returned.
Example: a > b is true, then max=a; is false, then max-b
Objecy= (flag > = N)? 1PUR 0numma object? Num:num*1.1;LED=mode? ((treadmill_i > (treadmill_i-7))): (treadmill_i
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.