![]() Not equal operator can be used to combine simple conditions and form compound conditions or boolean expressions. Hello Example 5: Not Equal Operator in Compound Condition You can use not equal operator in while loop condition. Example 4: Not Equal Operator in While Condition ![]() In this example, we shall use Not Equal operator to check if two strings are not equal.Ĭlearly, the two strings are not equal and the result of a != b is True. Example 3: Not Equal Operator with Strings In the following example, we shall use not equal operator in IF statement condition.Ī%2 != 0 returns True for a=11. Therefore, this can be used in conditions of decision making statements. We already know that not equal operator returns a boolean value. Example 2: Not Equal Operator with IF Statement In this example, we shall take two integers, and check if they are not equal using !=.Ī and b are not equal and therefore a != b returned True.Ī and c are equal and therefore a != b returned False.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |