Presentation is loading. Please wait.

Presentation is loading. Please wait.

Type Conversion It is a procedure of converting one data type values into another data type In C programming language we are having two types of type conversion.

Similar presentations


Presentation on theme: "Type Conversion It is a procedure of converting one data type values into another data type In C programming language we are having two types of type conversion."— Presentation transcript:

1 Type Conversion It is a procedure of converting one data type values into another data type In C programming language we are having two types of type conversion 1. Implicit type Conversion 2. Explicit type Conversion

2 Implicit Type Conversion
It is a procedure of converting lower data type values into higher data type, and this is also called as widening conversion This conversion is automatically done by the compiler Eg:- int i, float f; i=234; f=i; // output:

3 . Widening conversion double float long char int short byte

4 Explicit Type Conversion
It is a procedure of converting higher data type values to lower data type , and this is also called as narrowing conversion As a programmer it is required to handle explicit type casting process

5 . Eg:- int a=10,b=3; float b=a/b; Output:- b= As this is not correct output, to get the correct output we need to go for explicit type conversion or explicit type casting i.e float b=(float)a/b; Output:

6 . double float long Narrowing Conversion char int short byte


Download ppt "Type Conversion It is a procedure of converting one data type values into another data type In C programming language we are having two types of type conversion."

Similar presentations


Ads by Google