Free CompTIA ITF+ FC0-U61 Practice Question

You are tasked with writing a program that outputs a customization message based on the time of day. Which code snippet correctly uses branching to output 'Good morning!' when the variable 'currentTime' is less than 12?

  • if (currentTime < 12) { print('Good morning!'); }

  • if (currentTime = 12) { print('Good morning!'); }

  • if (currentTime > 12) { print('Good morning!'); }

  • if (currentTime == 12) { print('Good morning!'); }

This question's topic:
CompTIA ITF+ FC0-U61 / 
Software Development Concepts
Your Score:

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot