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
What statement best describes Konrad Zuse?
vazorg [7]

Answer:

D

Explanation:

Konrad Zuse was a German civil engineer, inventor and computer pioneer. His greatest achievement was the world's first programmable computer; the functional program-controlled Turing-complete Z3 became operational in May 1941.

8 0
3 years ago
Read 2 more answers
Why computer known as tool of information​
S_A_V [24]

Answer:

because it has the ability to capture the whole information you need or downloaded

8 0
2 years ago
Why are the keys on the qwerty keyboard arranged the way they are?
sveticcg [70]
Sholes arranged the keys in their odd fashion to prevent jamming on mechanical typewriters by separating commonly used letter combinations.
7 0
3 years ago
How do you know when a spreadsheet object is active in a powerpoint presentation?
Ira Lisetskai [31]
It should be under lined, when you press it it should have a different colour
4 0
3 years ago
Ignore this it a temporary note for me: SPSstudents
Westkost [7]

Answer:

okk

Explanation:

3 0
1 year ago
Other questions:
  • What is Software? Write the functions of Software?​
    11·1 answer
  • What is a main cause of a virus on a computer
    6·1 answer
  • Why should you need to have skills and an understanding about programming?
    8·1 answer
  • 9.1.3: Printing vector elements with a for loop. Write a for loop to print all NUM_VALS elements of vector courseGrades, followi
    5·1 answer
  • Choose the reasons why Windows Server operating systems are a popular choice for a network because they _____. Select all that a
    12·1 answer
  • Agent Phil Coulson developed this program to register Avengers in S.H.I.E.L.D's database using cutting-edge programming language
    15·1 answer
  • HEPME <br> ZOOM<br> IN <br> STOP<br> GIVIJG<br> ME <br> LINKS <br> !!
    9·1 answer
  • How do you put text in MS publisher?<br><br> When do you use text wrapping?
    14·1 answer
  • PLEASE ANSWER! I NEED IN 30 MIN.
    10·1 answer
  • Python Programming
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!