![]() |
VOOZH | about |
Typecasting
Type conversion happens when we assign the value of one data type to another. If the data types are compatible, then Perl does Automatic Type Conversion. If not compatible, then they need to be converted explicitly which is known as Explicit Type conversion. There are two types of typecasting:z is 70 w is 5713
Numbers are 27 and 13 Sum of the numbers = 40
sprintf function
This sprintf function returns a scalar value, a formatted text string, which gets typecasted according to the code. The command sprintf is a formatter and doesn't print anything at all. Output:Numbers are 25 and 13 Sum of the numbers = 38