Зміст курсу
C# Basics
C# Basics
Challenge: Operators
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
1. Make sure the subtraction is performed in the first step.
namespace TestConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
int result = (10 + 20) * 40 / (10 - 5);
Console.WriteLine(result);
}
}
}
Все було зрозуміло?
Секція 1. Розділ 11
Зміст курсу
C# Basics
C# Basics
Challenge: Operators
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
1. Make sure the subtraction is performed in the first step.
namespace TestConsoleApp
{
internal class Program
{
static void Main(string[] args)
{
int result = (10 + 20) * 40 / (10 - 5);
Console.WriteLine(result);
}
}
}
Все було зрозуміло?
Секція 1. Розділ 11