Here, we will create a case in-sensitive PI constant using the defined function.
The syntax of define() function,
define(constant_name,value,flag);
Here, the first parameter specifies the name of the constant and the second parameter specifies the value of the constant and the flag is used for case insensitivity, if we pass TRUE for the flag then the name of the constant will be case insensitive.
Program/Source Code:
The source code to create a case in-sensitive constant using the define() function is given below. The given program is compiled and executed successfully.
Output:
Explanation:
In the above program, we created a case insensitive constant PI using the define() function that contains value 3.14. Then we created a local variable $radius initialized with 5. Then calculate the area of the circle and print the result on the console screen.
need an explanation for this answer? contact us directly to get an explanation for this answer