jademartin3564 jademartin3564
  • 14-09-2019
  • Computers and Technology
contestada

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

1 to x.

Respuesta :

ExieFansler ExieFansler
  • 17-09-2019

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.

Answer Link

Otras preguntas

What is the symbiotic relationship between cuckoo bird and warbler?
What is the transfer of heat by the flow of a heated material?
Solve for x. 2x^2+7x−5=0 1.) x= 2/(−7±√89) 2.) x=4/(−7±√3) 3.) x= 4/(−7±√89) 4.) x= 2/(−7±√3)
Quanto mais aprendemos, maior nosso cérebro fica? (com prefencia, dê referencias bibliográficas)
When jazz is written down with notes for each instrument to play it is called?
Which word is the most likely definition for the word magnitude??
What do you call a group of boys and girls in spanish?
when are sports drink most effective ?
Which of the following sources is most likely to contain accurate information about statistics of illegal drug use in the United States? A report from drug enfo
How do I solve this proof?