The operator in this system is called an equal value operator though it introduced the == operator in the foregoing paragraph.
The following two kinds are prepared in the value operator.
| Sign | It truly becomes it. | It becomes an imitation. | |
|---|---|---|---|
| == | Two values are equal. | Two values are not equal. | |
| != | Two values are not equal. | Two values are equal. |
This..program..execute..have..input..result..as follows..become.#include <stdio.h> int main(void) { int suuti; scanf("%d",&suuti); If (suuti == 10) Printf ("The input value : 10 \n"); If (Suuti = 10) Printf ("The input value : 10 \n"); return 0; }
It has ..the execution of this program.. and the result becomes as follows about .....
10 Input data
The input value,
135 Input data
The input value 10. Then, it is not.
][ Because of operator it
This relative operator and the relation and the boolean explains next are operators.
In a word, it is possible to use it to calculate by usually putting it in the expression.
The following expression is a variable With val1 Val2 :.
When it is equal It is 1 in answer (In a lot of compilers).
When it is not equal 0 is substituted.
It is not possible to recommend to you and to do though the senior has the person who likes such way.answer = val1 == val2;
The value operator : whether two values are equal though it was an examined operator.
The relational operator is an operator that examines the magnitude correlation of two values.
| Sign | It truly becomes it. | It becomes an imitation. |
|---|---|---|
| < | Left values are smaller than the right. | Left values are not smaller than the right. |
| > | Left values are larger than the right. | Left values are not larger than the right. |
| <= | A left value is below the right. | A left value is not below the right. |
| >= | A left value is more than the right. | A left value is not more than the right. |
These operators are used to examine the magnitude correlation of two values.
The input number : the following program Judge be larger than ten.
This..program..execute..have..input..result..as follows..become.#include <stdio.h> int main(void) { int suuti; scanf("%d",&suuti); If (suuti == 10) Printf ("The input value : 10 \n"); If (Suuti > 10) Printf ("The input value : More greatly than ten. \n". ); If (Suuti < 10) Printf ("The input value : It is smaller than ten. \n". ); return 0; }
It has ..the execution of this program.. and the result when a large input is done becomes as follows from .....
10 Input data
The input value,
It has ..the execution of this program.. and the result when a small input is done becomes as follows from .....
135 Input data
The input value It is larger than ten.
5 Input data
The input value It is smaller than ten.
The boolean : in an operator different for a moment from a current operator.
Two or more conditions are integrated, and it is used to reverse the judgment.
| Sign | Meaning | It truly becomes it. | It becomes an imitation. |
|---|---|---|---|
| && | And,(AND) | The truth both of right, left conditions | Either of a right, left conditions is imitations even by one. |
| || | Or,(OR) | Either of a right, left conditions is the truth even by one. | Imitation both of right, left conditions |
| ! | No. (NOT) | The condition is an imitation. | The condition is the truth. |
The result when this program is executed and it inputs between 8-12 becomes as follows.#include <stdio.h> int main(void) { int suuti; scanf("%d",&suuti); If (Suuti > = 8 & suuti < = 12) Printf ("It is between 8-12. \n"); If ((suuti > = 8 & suuti < = 12)) Printf ("It is not between 8-12. \n"); return 0; }
The result when this program is executed and it inputs between 8-12 becomes as follows.
9 Input data
It is between 8-12.
The point of this program is in the part of the condition of the if sentence.
3 Input data
It is not between 8-12.
Moreover, the judgment of the second if sentence will judge ..one.. eyes. The operator was only added.
Because it is an operator that has it, the operator : the function of reversing the judgment result.
It completely becomes an opposite outcome with if sentences of one of eyes.