Ask Question
20 December, 09:34

Is there a syntax error in the following code? bool hourlyWorker = true; if (hourlyWorker) cout << "The employee is an hourly worker./n"; else cout << "The employee is not an hourly worker./n";

+2
Answers (1)
  1. 20 December, 11:46
    0
    No, there is not

    Explanation:

    The code will print - > The employee is an hourly worker.

    Here is how:

    - hourlyWorker is set as true

    - Then we check this part of the code - > if (hourlyWorker)

    - If this is true, then the code will print "The employee is an hourly worker."

    - If not, then the code will print "The employee is not an hourly worker."

    Since if (hourlyWorker) is true, it will print "The employee is an hourly worker."
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Is there a syntax error in the following code? bool hourlyWorker = true; if (hourlyWorker) cout ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers