Computer Applications
Answer
Type casting is a data conversion in which the data type of the result in a mixed mode expression, gets converted into a specific type as per user's choice. The choice of data type must be written within braces ( ) before the expression.
For example,
int a; float b; char c;
char d = (char) (a + b * c);
Related Questions
Define the following with an example:
(a) variable
(b) constant
(c) boolean data type
(d) coercion
(e) primitive data type
(f) non-primitive data type
What is a token? Name different types of tokens.
Assign the following to a variable with suitable data type.
(a) m = 22 / 7
(b) p= 1.4142135 (value of square root of 2)
(c) k= 0.00004545
(d) n=24.50
Distinguish between Token and Identifier