mediumMultiple ChoiceObjective-mapped
FC0-U71 INPUT statement Practice Question
Exhibit
Refer to the exhibit. ``` 10 PRINT "Enter your name:" 20 INPUT name$ 30 IF name$ = "" THEN GOTO 10 40 PRINT "Hello, " + name$ 50 END ```
Refer to the exhibit. A developer wrote this BASIC program. What will happen if the user presses Enter without typing a name?
⚠ Common exam trap
Candidates may assume the program includes input validation, but the exhibit shows a straightforward INPUT without any loop or check, so an empty input simply prints 'Hello, '.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The program will print "Hello, " with no name.
The program shown in the exhibit likely uses a simple INPUT statement to read a name, followed by a PRINT statement that outputs 'Hello, ' and the entered value. If the user presses Enter without typing anything, the INPUT statement reads an empty string into the name variable. Consequently, the program prints 'Hello, ' with nothing after it. There is no validation to re‑prompt or check for an empty input, so no error occurs and the program does not loop.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The program will print "Hello, " with no name.
Why this is correct
Correct. The program prints 'Hello, ' followed by the empty string, resulting in 'Hello, ' with no name shown.
- ✗
The program will display an error message.
Why it's wrong here
Incorrect. BASIC's INPUT command accepts an empty string without raising an error.
- ✗
The program will prompt for input again.
Why it's wrong here
Incorrect. The program does not include a loop or validation; it proceeds to print after a single input, even if empty.
- ✗
The program will end with no output.
Why it's wrong here
Incorrect. The program always prints something (at least 'Hello, ') provided the INPUT statement completes successfully.
Go deeper
Related to this question
About these practice questions
One of 988 original FC0-U71 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This FC0-U71 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the FC0-U71 exam.