Question: Short circuit evaluation is when the language evaluates the first portion of a BOOLEAN expression and if, knowing the result of the value, then skips
Short circuit evaluation is when the language evaluates the first portion of a BOOLEAN expression and if, knowing the result of the value, then skips the evaluation of the second expression. For example, A & B is false if A is false... no need to evaluate B. A similar scenario is true for OR. Most languages implement short circuit evaluation
create a program for the following languages:FORTRAN and JAVA.
Write the summary of your result
An example could look like:
function f()
{ write('I have been evaluated'); return(1); }
main() { int i=1;
if ( i ==0 && f() ) then write ('true') else write ('false)
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
