Hello guys, I hope that you are enjoying my blog posts. If you liked my posts then don’t forget to share this site to your friends and do give a review.
Now, we will discuss about the Comma Operator :
- Comma operator some time treated as a Separator also.
We will take one example to understand how it will work :
main()
{
int i = 10, j =20 , k =30; //Here comma ( , ) operator treated as a separator of i , j and k variables
k = i , j; //Here comma ( , ) act as a operator
printf(” %d %d %d”, i , j , k);
}
Now we will discuss about Increment and Decrement Operator:
- This operator is a unary operator. It needs only one operand to perform a task.
- There are two types of the category are there :
- Pre – Increment/Decrement ( i.e. ++a, –a)
- Post – Increment/Decrement ( i.e. a++ , a–)
- It will modify the operand value. So constant is not allowed ( i.e. 10 ++ is expression is totally wrong).
Pre increment:
Post Increment :
- Same you must do and it will be decrement operator.
Leave a Reply