Problemas
What will the following code do? var cost=readFloat'' Enter cost:"): println(cost); Ask the user to input a cost and display it as a float Read an integer and display it Display "Enter cost:" without accepting input Cause a syntax error
Roztwór
Iván
professionell · Tutor durante 6 años
4.6
(288 Votos)
Respuesta
The code will cause a syntax error. The correct syntax for reading a float input in Pascal is `readln` instead of `readFloat`. Therefore, the line `cost=readFloat''\quad Enter` is incorrect and will result in a syntax error.