Posts

Showing posts with the label Question 1: What is the use of Implicit typecasting? Question 2: What is the use of explicit typecasting?

Programming in C, Implicit typecasting, Explicit typecasting

 Question 1: What is the use of Implicit typecasting? Ans: Implicit typecasting is performed automatically by the compiler without programmer’s intervention. In this type of casting the compiler converts all operands into the data type of the largest operand.  For example in the program given below, compiler converts the sum of two float numbers to an int.      #include< stdio.h      void main(void)      {                 float value 1 = 2.5;                float value 2 = 5.3;                int result;                result = value 1 + value 2;                printf(“Result: %d”, result);      }      Question 2: What is the use of explicit typecasting? Ans: Explicit typecasting...