Inicio
/
Tecnología
/
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

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
Weryfikacja ekspertów
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.