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 a dummy run​
what is chief legislator ​
Dohn Joe and Dane Joe wants to have children and are thinking about how their children's hairline and tongues will turn out. They are both circus performers and
5. The Labradoodle is a mixed-breed dog that ____ hair instead of fur for warmth, making it a very attractive choice for allergic pet owners.
Identify the statements that CORRECTLY describe the Freedman's Bureau. It was officially called the "The Bureau of Recently Emancipated Citizens of the United
A 2,294N force is applied to a 408kg mass. What is the acceleration of the mass?
How can traditions and practices promote health​
True or False: Many abolitionist were Republicans and their main goal was to end the institution of slavery.
what is 456% as decimal
Ethan and his three friends go to dinner. The total bill was $58.90 and they decide to leave a tip of 18%. There is no tax. They split the bill. How much do