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
A program called a ( n ) ____ translates instructions written in high-level languages into machine code.
Mazyrski [523]
A program called an compiler
5 0
4 years ago
Zoe wants to post something controversial online, but then she remembers that employers may look at her social media when she st
allsm [11]

Answer:

D

Explanation:

7 0
2 years ago
This is a wise and hard question.....What is the hardest question in the world? I know the answer do you?
SpyIntel [72]
Is it this question? I think the hardest question in the world is the one you just asked! Am I right?
8 0
3 years ago
You are looking at computer ads. One has a processor that is 3.64GHz. What does this mean?
aliina [53]

Answer:

The higher the clockspeed the more the cpu can do

Explanation:

8 0
3 years ago
What are some catchy names for computer basics that you would put on a childrens poster?
Triss [41]

Answer:

not sure

Explanation:

6 0
3 years ago
Other questions:
  • What does software alone enable a computer to do? connect to the Internet control processing speeds interact with the user manag
    11·2 answers
  • Consider a movie database in which data is recorded about the movie industry. the data requirements are summarized as follows:
    15·1 answer
  • Write a program "addnumbers.c" where it takes as many arguments as the user includes as command line arguments and calculates th
    11·1 answer
  • Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
    13·1 answer
  • Add Try/Catch error checking To make sure that the user enters valid values in your program. To catch negative values passed to
    9·1 answer
  • Create a vector of structures experiments that stores information on subjects used in an experiment. Each struct has four fields
    12·1 answer
  • The reason why our computers can get faster without getting bigger is because of...
    14·1 answer
  • Which two peripherals are not required to browse the internet?
    8·1 answer
  • The international system of units is very important to our worldwide science community because it is easier for scientists to sh
    12·1 answer
  • Ethics related to all <br> artificial intelligence?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!