In this segment, we're going to look at two of the more odd ball operators we have in the C language. The first of them is a conditional operator. It's question mark colon. The second one is the comma operator. Again, as with lots of things in C, things get overused. So comma can occur in many places. It's not always a comma operator, sometimes it's a lists separator. Question mark can be something elsewhere and question mark colon, the conditional operator is uniquely the only ternary operator. So here's an example of use of the question colon mark and syntax, in this example is c assigned a less than b which is a relational expression. Remember it will evaluate to zero or one true or false. Well, zero is false, one is true. Depending on which that's the question mark, if it's true, the value of the expression is a and if it's false, the value of the expression is b. We can express this as an ordinary if then else. So if we wanted to, we could avoid the ternary operator. It just means if a less than b, then c is replaced by a, lc is replaced by b. So notationally, we have a ternary operator which saves us a lot of writing. So that's what you might say is big value. It stirs it's concise. The general syntax is there's an expression typically the expression that's taken to be zero and non-zero. Then depending on the expression, it evaluates either expression one, the true part or expression two here, the false part. Another characteristic of this is very low and precedence so it occurs as one of the last things that would be evaluated. So third lowest precedence among the 16 levels of precedents in the language. It's also unique in that it's the only ternary operator in C. So that's an interesting factoid. On the other hand, the comma operator is written as this; expression1, expression2 and its semantics are first expression1 gets evaluated. Only after that does expression2 get evaluated and the value of the overall expression is expression2. This comma operator is also known as a sequence point. In other words, expression one must be operated on first before expression2 is done. That's very important because C is a language that allows side effects and the side effects can affect it depending on order of evaluation what the outcome of the program is. So we have an operator like a plus b symmetric addition operator, binary operator, there may not be a specified or evaluation, and different compilers may for optimization purposes do different orders of evaluation, that's very poor practice, you don't really want a program to be non portable in that way, but you have to be aware of that as possibly something that would give rise to spurious results. The other thing about this is that it's the lowest precedence operator. So it gets done in layers and is just below the assignment operators or the operator assignment operators, any of these assignment operators are next the lowest. As we said, the ternary operator, conditional operators third lowest and so I just said it's a sequence point. Sequence point is also important for the logical and, and logical or and it's also comes up when you see a semicolon ending a statement, that's always a sequence point. In other words, everything has to be done before you move on to the next statement. Similarly, if you have two expressions in a logical and, the first one must be done first. Then only if the first one is true, does the second one to get evaluated. Here's an example. C is assigned a, is assigned 0, b is assigned 1. The value of this parenthesize expression ends up being 1. So if we use this print f, we would see one. We would have as a side effect a assigned zero. Now, that seems like a weird thing to want but it does come in useful idiomatically in a place you see this most and where it's acceptable is enforced statements. So you might see an expression like for sum, zero equal assign zero, i assign 1. So you might want to assign several things at the beginning of a loop and then you test for the terminating condition. In this case, i less than or equal to 50 and here's your final step in each iteration where you're incrementing i. You can see that this for statement is going to be a sum which ultimately, you'll add up well, what does the for loop do? Let me give you a few seconds here to think about it yourself. Time is up. It should have been obvious. Sum was initialized to zero, i to one and then by the end of the loop, we'll have some one to 50. This is a standard idiom for initializing for-loops.