Last active
April 23, 2022 11:01
-
-
Save GigaOrts/e3b6e2d6c40a85460a5fff7b1a967e3a to your computer and use it in GitHub Desktop.
Домашка 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Задача "Что выведется в консоль и почему?" | |
int a = 10; | |
int b = 38; | |
int c = (31 – 5 * a) / b; | |
Console.WriteLine(c); | |
Выведется 0, потому что в примере явно типизированные int значения a, b и c соответственно может сохранить в себе только целое число, в итоге от ответа (-0.5) отбросится дробная часть и останется нуль. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment