How many times 'hello' will be displayed?
for var=0 to 4 step 1 do
if var==2*var then do
display "hello"
end-if
end-for
Answers
Answer:
this is your answer please mark me brainleast. plz
Answer:
Once.
Explanation:
Here the code is:
for var = 0 to 4 THEN
if var == 2 * var THEN
display "hello"
end-if
end-for
This is a FORTRAN code. FORTRAN is a general-purpose, compiled imperative programming language. It is mainly used in the areas such as numerical weather prediction, computational fluid dynamics, geophysics, computational physics and crystallography . It is a popular language for high-performance computing and is used for programs that rank the world's fastest supercomputers.
In this code, since the condition is that var needs to be equal to 2 multiplied by var and that is possible only in the first case when var is equal to 0, when 2*0 will be equal to 0 which will be equal to var.
Hence, hello will be printed once only.
#SPJ3
To know more about FORTRAN, also visit:
https://brainly.in/question/333151?msp_srt_exp=4
https://brainly.in/question/21284621?msp_srt_exp=4