Type Conversion in C programming Language with example program

Spread the love
Pre-increment-and-Pre-decrement-operators-in-c-language

Program to understand type conversion in C Language :

In this program, We are going to look at the Type Conversion in C language.

Type conversion in C Program Output:

Program Explanation:

As you can see from the comments in the above program, There are a lot of implicit type conversions in the program.

Like variable i1 value implicitly converting from the float value to int value.

C Language does implicit type casting to fit the values into the target variable. For example,

int i1 = 80.56;

Here the target variable i1 is an integer, So C language is implicitly converted the float value 80.56 to 80 and assigned to the variable i1.

C language also supports the explicit type conversion, Where we need to specify the compiler to covert the value from one datatype to another datatype. There are cases, where we need to explicitly perform the type conversions. We are going to discuss them in the upcoming articles.

Tutorials – Index:

Venkat

Hi Guys, I am Venkatesh. I am a programmer and an Open Source enthusiast. I write about programming and technology on this blog.

You may also like...

Leave a Reply