Cast operator in C Programming

Cast operator

Cast operator can be used to explicitly convert the value of an expression to a different data type. To do so, the name of the data type to which the conversion is to be made is enclosed in parenthesis and placed directly to the left of the expression whose value is to be converted.Its general format is
(data type) expression

Example:

int i= (int)3.14;
float j= (float)10/2

Example:

Ready to get started?

Ready to embark on your journey into the world of C programming? Our comprehensive course provides the perfect starting point for learners of all levels. With engaging lessons, hands-on exercises, and expert guidance, you'll gain the skills and confidence needed to excel in this fundamental programming language. Let's dive in and unlock the endless possibilities of C programming together!