1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sp2606 [1]
3 years ago
11

What is wrong with the following if statement (there are at least 3 errors).

Computers and Technology
1 answer:
Gwar [14]3 years ago
7 0

In programming, if statements are used to test conditions. The statement to be executed will be determined by the result of the conditions. A statement will be executed if its accompanying condition is true.

The errors in the given code segment are as follows:

  1. The if condition on line 1 should be in a closed bracket; i.e. ()
  2. The if condition has more than 1 statements to execute. So, it requires a curly bracket; i.e. {}
  3. The second part of the first condition should be == 4 and not =4; because the proper operator to make comparison is == while = is used as an assignment operator

The correct code is as follows:

<em>if (numNeighbors >= 3 || numNeighbors == 4) { </em>

<em>++numNeighbors; </em>

<em>printf ("You are dead! \n “); } </em>

<em>else </em>

<em>--numNeighbors;</em>

<em />

Read more about conditional statements at:<em> </em>

brainly.com/question/20228453

You might be interested in
Universal Containers (UC) is currently live with Sales Cloud and in the process of implementing Service Cloud. UC wants to creat
lora16 [44]

Answer:

  1. <u>Partial Copy Sandbox,</u>
  2. <u>Full Sandbox,</u>
  3. <u>Developer k Pro Sandbox</u>

Explanation:

Note that, cloud services are made possible by computer programming, and <em>soundboxes are used by Software developers to test new programming code before implementation</em>.

Therefore, for UC to successfully test its Service Cloud implementation with real Sales Cloud data this three soundboxes are best suitable.

3 0
3 years ago
Antonio’s computer is hung up. which trio of keys should he press to restart his computer?
IgorLugansk [536]

Ctrl + Alt + Delete is the keys used by some PCs to reboot frozen computers by using task manager to kill any nonresponding applications. Another way to do this on some other is Ctrl + Shift + Esc.

6 0
3 years ago
Read 2 more answers
Which type of database program is Microsoft Access 2016?
nadya68 [22]

Answer:

O relational

Explanation:

If I'm wrong I'm so so sorry! But form my research it keeps saying its relational.

If I'm right please give me brainliest I really need it to level up so please help me!

If you don't know how to give brainliest there should be a crown underneath my answer you just have to click it.

Thank you and have a wonderful night,morning,afternoon/day! :D

6 0
3 years ago
Read 2 more answers
About how many jobs in the United States require Microsoft expertise?
GarryVolchara [31]
Answer: C because bill gates is the owner
5 0
3 years ago
Overview of your opinion of Digital Etiquette
Bas_tet [7]

Answer:

The basic idea behind the topic of digital etiquette is "treat others how you want to be treated." From an early age, students are taught this golden rule. Whether at home, at the movies, at a grocery store or in school, students learn that there are appropriate and inappropriate ways to behave and treat one another. With the overwhelming emerging technology and its involvement in our daily lives, it is fundamental that students transfer that understanding of appropriate behavior into the digital world.

4 0
3 years ago
Other questions:
  • Which best describes what Pavel should do differently for the kids book?
    13·2 answers
  • Which option marks all modification made within a document? Review Comment Track Changes Balloons
    15·2 answers
  • 4. Write an interface ObjectWithTwoParameters which has a method specification: double area (double d1, double d2) which returns
    9·1 answer
  • What is the output of the AWK program?
    11·1 answer
  • If your hood suddenly flies up you should turn on your hazard lights and continue driving. True or false?
    10·2 answers
  • Many interesting science-, technology-, engineering-, and math-oriented websites provide open-source data to the public. Which o
    8·1 answer
  • Why does a bus topology require a terminator? a) because otherwise it would be a ring network b) because otherwise the packets w
    10·2 answers
  • 3. List three common vector image file types.
    7·1 answer
  • Select the correct text in the passage.
    15·1 answer
  • Which factors have increased the need for the latest cybersecurity technologies?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!