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
F a domain consists of dcs that are running verions of windows server earlier than windows server 2008, what replication method
garri49 [273]
F is the grade I would give you if I were teaching you because your a 2008 Skid. You probably don't even know Html.

5 0
3 years ago
Does Windows 7 support secure boot in UEFI? Windows eight? Linux UBUNTU version 14?
Anni [7]
Yes, windows 7 does support secure boot in UEFI. UEFI allows for backward compatibility. IT can boot a MBR hard drive and provides a BIOS boot through its Compatibility Support Module (CSM) feature.
4 0
3 years ago
The most efficient way to perform data entry is to keep your hands on the keyboard and press _______ to move to the next cell in
SCORPION-xisa [38]
The correct answer is C. Tab; enter
5 0
3 years ago
Assume that name has been declared suitably for storing names (like "amy" , "fritz" and "moustafa") write some code that reads a
tamaranim1 [39]
Name = "Bob"
# or you can prompt the user to enter their name:
# name = input("What's your name? ")

print("greetings," , name)
3 0
3 years ago
What are the data types used in C programming with examples
Zepler [3.9K]
I don’t really understand what you are trying to ask. Try posting a picture along with your question
5 0
3 years ago
Other questions:
  • If you purchase a software suite for personal use, you can install the software how many times on how many different machines?
    6·1 answer
  • Explain how to use fortran programming in details
    14·1 answer
  • Infrared, a wireless connection used in the past prior to bluetooth, was limited because it ________.
    10·1 answer
  • Consider an environment in which there is a one-to-one mapping between user-level threads and kernel-level threads that allows o
    7·1 answer
  • A defensive driver's priority is __<br> A. efficiency<br> B. speed<br> C. handling<br> D. safety
    9·2 answers
  • When working with arrays, most programming languages perform ________, which means they do not allow programs to use invalid sub
    5·1 answer
  • Number are stored and transmitted inside a computer in the form of​
    6·1 answer
  • Question 2 of 3
    7·2 answers
  • Does nature behave the exact same way as fractals?
    15·1 answer
  • An e-commerce client is moving from on-premise, legacy systems to a cloud-based platform. During the transition, the client is a
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!