Special Operators In C

Special Operators

The Comma Operator

  • The Comma operator  can be used to link the related expressions together.

Example For Comma Operator

Comma Operator In for Loops
for(i=0,j=1;i>10:i++,j++)

Comma Operator In while Loops

While(c<10,c--)

Type cast Operator

Syntax:

( type )

Explanation

  • converts a to the specified type.
  • Note that the use of a parenthesized type in a method declaration or definition is not an example of the use of the type cast operator.

Example For Type Cast Operator

Float s= 12.5;    int a;
a = (int) s;
now a value is 12.

 

Top Pages