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
devlian [24]
3 years ago
15

Ternary operators of computerplease explain. ​

Computers and Technology
1 answer:
Nitella [24]3 years ago
5 0

Answer:

It's a compact way of doing an if-else statement.

General Format is

<<em>condition</em>> ? <if condition is true> : <else>;

Example:

I could rewrite:

  if(a==1) temp = 1;

  else     temp = 999;

as

  temp = (a==1) ? 1 : 999;

You might be interested in
( No links) Which of these devices can be used to back up digital photographs?
MakcuM [25]

Answer:

flash drive

external hard drive

computer hard drive

hope that helps o(*^@^*)o

4 0
3 years ago
Read 2 more answers
To find all the prime numbers less than or equal to a given integer n by Eratosthenes' method: 1. Create a list of consecutive i
natta225 [31]

Answer:

I am writing a Python program:

def Eratosthenes(n):  

   primeNo = [True for i in range(n+1)]  # this is a boolean array

   p = 2  # the first prime number is initialized as 2

   while (p * p <= n):     # enumerates all multiples of p

       if (primeNo[p] == True):                

           for i in range(p * p, n+1, p):  #update multiples

               primeNo[i] = False

       p = p + 1        

   for p in range(2, n):   #display all the prime numbers

       if primeNo[p]:  

           print(p),    

def main():     #to take value of n from user and display prime numbers #less than or equal to n by calling Eratosthenes method

   n= int(input("Enter an integer n: "))

   print("The prime numbers less than or equal to",n, "are: ")  

   Eratosthenes(n)      

main()      

Explanation:

The program contains a Boolean type array primeNo that is initialized by True which means that any value i in prime array will be true if i is a prime otherwise it will be false. The while loop keeps enumerating all multiples of p starting from 2, and striking them off from the original array list and for loops keep updating the multiples. This process will continue till the p is greater than n.  The last for loop displays all the prime numbers less than or equal to n which is input by user. main() function prompts user to enter the value of integer n and then calls Eratosthenes() function to print all the prime numbers less than or equal to a given integer n.

   

7 0
3 years ago
It's important to understand that even information systems that do not use computers
Delvig [45]

Answer:

yes I am not sure if you have any questions or concerns please visit the plug-in settings to determine how attachments are handled the situation in the measurements of the season my dear friend I am not sure if you can send you a great day to day basis of

6 0
3 years ago
List of all the storage devices that you use for storing your school projects and assignments then state the reason you chose th
Dmitry [639]

Answer:

I use my oldest computer to store my information

Explanation:

I use my old computer to store things because it does not function properly such as taking a slow time loading or shutting down completely so I use it to store my data.

6 0
4 years ago
Read 2 more answers
If you need to set up direct deposit, which information from your check would you likely need?
Effectus [21]
You just need some direct depodsit forms and who ever paying you and also you need your voided check.Your checking account number,Your bank's ABA or routing number,<span>Your bank's address that's all you need.</span>
6 0
3 years ago
Other questions:
  • Fill the validateForm function to check that the phone number contains a number (use the isNaN function) and that the user name
    8·1 answer
  • You have a notebook computer and wish to connect to an IEEE 802.11ac wireless network. The computer does not have a built-in WLA
    15·1 answer
  • True or false.local and cloud backup differs in where the backup is saved
    15·2 answers
  • The major difference between a calculator and a computer, when performing calculations, is that a
    12·1 answer
  • To create a new table by using a select statement, you code the ___________________________ clause.
    14·1 answer
  • Power point programm<br><br>​
    11·1 answer
  • If Z=52 and ACT=48 then BAT=​ with explanation??​
    12·1 answer
  • HEPME <br> ZOOM<br> IN <br> STOP<br> GIVIJG<br> ME <br> LINKS <br> !!
    9·1 answer
  • What Microsoft feature enables you to represent text as colorful visuals
    12·1 answer
  • Under the fair use doctrine, which group of people are allowed to use certain
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!