Created
December 6, 2015 18:10
-
-
Save ProZhar/0382b9d0e065dbe952a1 to your computer and use it in GitHub Desktop.
com.javarush.test.level10.lesson04.task02
This file contains hidden or 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
| package com.javarush.test.level10.lesson04.task02; | |
| /* Задача №2 на преобразование целых типов | |
| Расставьте правильно операторы приведения типа, чтобы получился ответ: d=3.765 | |
| int a = 15; | |
| int b = 4; | |
| float c = a / b; | |
| double d = a * 1e-3 + c; | |
| */ | |
| public class Solution | |
| { | |
| public static void main(String[] args) | |
| { | |
| int a = 15; | |
| int b = 4; | |
| float c = (float) a / b; | |
| double d = a * 1e-3 + c; | |
| System.out.println(d); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment