alexey3017

1.2 - Переменны ч2

Mar 19th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Learn1
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int a = 10;
  14.             int b = 38 * 17;
  15.             int c = (31 - 5 * a) / b;
  16.             Console.WriteLine(c);  
  17.             // в переменной а остается 10 в переменной b = 646
  18.             // значит сначала выполняется по приоритету что в скобке а это умножение 5 * 10 = 50,
  19.             // 31 - 50 = -19
  20.             // -19 / 646 = 0 так как отрицательное число делится
  21.         }
  22.     }
  23. }
Add Comment
Please, Sign In to add comment