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
Yakvenalex [24]
3 years ago
9

Write an if/else statement that assigns 0 to x when y is equal to 10; otherwise it should assign

Computers and Technology
1 answer:
Liono4ka [1.6K]3 years ago
7 0

Answer:

if(y==10)

{

     x=0;   // assigning 0 to x if y equals 10.

}

else

{

   x=1;   // assigning 1 to x otherwise.

}

Explanation:

In the if statement i have used equal operator == which returns true if value to it's right is equal to value to it's left otherwise false.By using this operator checking value of y and if it is 10 assigning 0 to x and if it is false assigning 1 to x.

You might be interested in
Which of the following statements is true? A. Interpreted programs run faster than compiled programs. B. Compilers translate hig
alina1380 [7]

Answer:

B.

Explanation:

Computer programs are written in high level languages. Every language has its own set of syntax and semantics.

Computer only understands instructions in machine language which is written using strings of 0 and 1.

Thus, for execution of a high level language program, it is mandatory to convert high level instructions into machine instructions.

This translation into machine language is done in two ways – compilation or interpretation.

Some languages are compiled while others are interpreted.

Both compilers and interpreters are programs and process the high level language program as needed.

Compiler

Any program written in high level language is compiled.

The program is first analyzed before compilation. This process takes time. The analysis phase is called pre processing.

The program compilation stops only when the program is completely analyzed. Hence, it is difficult to locate the error in the program. This makes debugging easy.

Debugging is defined as removal of errors in the programs.

A compiler is responsible for converting high level language code into machine level code.

The complete program undergoes compilation at the same time.

A compiled program executes faster than an interpreted program.

A compiled program produce machine code which is a collection of 0 and 1, hence, it takes less time to execute.

Examples of compiled languages are C and C++.

Interpreter

Some high level languages are interpreted.

The high level language code is translated into an intermediate level code. This intermediate code is then executed.

The analysis of the program takes less time and takes place before interpretation begins. The analysis phase is called pre processing.

An interpreted program is translated one line at a time.

The program interpretation stops when an error is encountered. This makes debugging easy.

Debugging is defined as removal of errors in the programs.

Examples of interpreted languages include Python and Ruby.

6 0
4 years ago
Read 2 more answers
How does communication resolve problems​
Deffense [45]

Answer:

One major benefit effective communication has in resolving a conflict is the resultant reduction in anxiety, whether within a family or in the workplace. ... Using effective verbal – and nonverbal – communications further contributes to a successful resolution of conflict, either between individuals or within a group.

8 0
3 years ago
Read 2 more answers
What is the Computer Science ?!?!​
mezya [45]

\:  \:  \:  \:  \:

<h2><u>Computer</u><u> </u><u>science</u></h2><h2 />
  • <u>is the study of computation, automation, and information. Computer science spans theoretical disciplines, such as algorithms, theory of computation, and information theory, to practical disciplines including the design and implementation of hardware and software.</u>

<h2><u>What is computer science used for?</u></h2>

  • <u> Computer scientists use technology to solve problems. They write software to make computers do new things or accomplish tasks more efficiently. They create applications for mobile devices, develop websites, and program software.</u>

<h2><u>hope</u><u> it</u><u> helps</u></h2>

3 0
3 years ago
Read 2 more answers
A bank wants to reject erroneous account numbers to avoid invalid input. Management of the bank was told that there is a method
netineya [11]

Answer:

validity check

Explanation:

validity check

4 0
3 years ago
Iwill give 20 points and.
GarryVolchara [31]

The answer is ELECTRICITY

8 0
3 years ago
Read 2 more answers
Other questions:
  • Which is the correct process for selecting an entire row in a spreadsheet?
    15·2 answers
  • Mila received a new DVD player that she is trying to connect to the back of her television by feel alone. The first stage of mem
    11·1 answer
  • What is key for evaluating internal controls such as human resources, logistics, information technology, risk, legal, marketing
    11·1 answer
  • Which definition of intelligence is based on the Turing test?
    8·1 answer
  • When do you use FTP?
    10·2 answers
  • Which of the following happens when you enter the formula =G15 into a cell?
    12·1 answer
  • Which of the following is not true about preprocessor directives
    7·1 answer
  • When are numbered lists generally used
    8·1 answer
  • "To speed up magnetic hard drive performance , ___________ is often used. "
    15·1 answer
  • Give three general reasons for the importance of computer networking.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!