Courseiva
mediumMultiple Choice

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

    Pressing Enter supplies an empty string to the INPUT variable, so the PRINT statement concatenates "Hello, " with nothing, outputting the bare greeting. The program does not validate or loop, satisfying the stem's condition of submitting no name rather than terminating or erroring.

  • ✗

    The program will display an error message.

    Why it's wrong here

    An empty INPUT response returns a null or empty string, which BASIC accepts without raising a runtime error. Error messages arise from type mismatches or invalid numeric conversions, not blank string entry, so this option misreads how the INPUT statement handles an empty response.

  • ✗

    The program will prompt for input again.

    Why it's wrong here

    Pressing Enter without a name submits an empty string, which the program accepts as valid input rather than looping. It is tempting to assume validation logic exists, but BASIC's INPUT statement stores the blank value and execution continues to the next line without re-prompting.

  • ✗

    The program will end with no output.

    Why it's wrong here

    Pressing Enter supplies an empty string, which the program accepts as valid input rather than terminating. Program termination would follow an explicit END or STOP statement, or an unrecoverable runtime error, not an empty INPUT response, so this outcome misreads how BASIC handles blank entries.

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 →

How Courseiva writes practice questions · Editorial policy

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.