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
Bingel [31]
3 years ago
6

Assume that an int variable is Quadrilateral has been declared, and that another int variable, number Of Sides has been declared

and initialized. Write a statement that assigns the value 1 if number Of Sides is exactly 4 and 0 otherwise.
Computers and Technology
1 answer:
kondor19780726 [428]3 years ago
4 0

Answer:

The answer to this question can be given as:

Statement:

isQuadrilateral = (numberOfSides == 4) ? 1 : 0;

//check condition using ternary operator.

Explanation:

we know that both(Quadrilateral, numberOfSides) is already declared in the program. So the statement for check condition is (isQuadrilateral = (numberOfSides == 4) ? 1 : 0;). To check this condition we use the ternary operator. In this operator, we also check another condition. The syntax of ternary operator (condition ? value_if_true : value_if_false).In this statement on the lift side we use the variable for check condition and right side we check condition if the value is true it prints 1 else it will print 0.

You might be interested in
HOW DO I DELETE A BRAINLY QUESTION?
Fantom [35]

Answer:

To delete a question you asked, click the arrow in the top right-hand corner of your question page and select Delete. If any answers have been added to your question, you'll have to request its deletion.Explanation:

8 0
3 years ago
Read 2 more answers
Write a simple nested loop example that sums the even and odd numbers between 5 and 15 and prints out the computation.
lianna [129]

Answer:

for e in range(6, 15, 2):

for o in range(5, 15, 2):

calc = e+o

print(e, "+", o, "=", calc)

Explanation:

4 0
3 years ago
An attacker on the network intends to overwhelm another computer with icmp packets as follows:
Blizzard [7]
And, the simple answer is to disable ICMP echo requests on either the router or Workstation.
4 0
3 years ago
As a producer you are willing to supply the most goods at the highest price this is because the highest price earns you the
aleksandrvk [35]

Answer:

most money

Explanation:

common sense

8 0
3 years ago
Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the compa
Katen [24]

Answer:

yes you can and i can yes

Explanation:

7 0
3 years ago
Other questions:
  • Which phrase best describes a scenario in Excel 2016?
    9·1 answer
  • Describe your dreams include lifestyle,job,house,friends
    5·2 answers
  • ____ is another term for document properties.
    12·1 answer
  • Read the following scenario, and then answer the question below.
    15·2 answers
  • When a workforce scheduling problems is formulated as an integer programming model, it has:?
    6·1 answer
  • When using a line graph, why is it inportant to only graph 1 - 3 series of data?. A. A line graph in Microsoft Excel will not al
    7·1 answer
  • What is the data type of the following expression?
    12·2 answers
  • Keli is unable to find a shape that meets her needs. Which feature in Power Point should she use to create shapes that are compl
    6·1 answer
  • 4 brainly
    9·1 answer
  • Gary says, "Ports are where data enter a network before reaching a gateway. The data travel via transmission
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!