Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Desafío: Operadores | Primeros Pasos
Fundamentos de C#

bookDesafío: Operadores

The program below outputs 115. Add a pair of brackets () in the statement (10 + 20) * 40 / 10 - 5 changing the order of operations in such a way that it outputs 240 instead.

main.cs

main.cs

copy
1234567891011
namespace TestConsoleApp { internal class Program { static void Main(string[] args) { int result = (10 + 20) * 40 / 10 - 5; System.Console.WriteLine(result); } } }
  1. Make sure the subtraction is performed in the first step.
main.cs

main.cs

copy
1234567891011
namespace TestConsoleApp { internal class Program { static void Main(string[] args) { int result = (10 + 20) * 40 / (10 - 5); System.Console.WriteLine(result); } } }

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 11

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

bookDesafío: Operadores

Desliza para mostrar el menú

The program below outputs 115. Add a pair of brackets () in the statement (10 + 20) * 40 / 10 - 5 changing the order of operations in such a way that it outputs 240 instead.

main.cs

main.cs

copy
1234567891011
namespace TestConsoleApp { internal class Program { static void Main(string[] args) { int result = (10 + 20) * 40 / 10 - 5; System.Console.WriteLine(result); } } }
  1. Make sure the subtraction is performed in the first step.
main.cs

main.cs

copy
1234567891011
namespace TestConsoleApp { internal class Program { static void Main(string[] args) { int result = (10 + 20) * 40 / (10 - 5); System.Console.WriteLine(result); } } }

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 11
some-alt