Advertisement
jaVer404

level10.lesson04.task02

May 3rd, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package com.javarush.test.level10.lesson04.task02;
  2.  
  3. /* Задача №2 на преобразование целых типов
  4. Расставь где нужно оператор приведения типа:
  5. int a = 15;
  6. int b = 4;
  7. float c = (a / (double)b);
  8. double d = a * 1e-3;
  9. */
  10.  
  11. public class Solution
  12. {
  13.     public static void main(String[] args)
  14.     {
  15.         int a = 15;
  16.         int b = 4;
  17.         float c = (float)(a / (double)b);
  18.         double d = a * 1e-3;
  19.  
  20.         System.out.println(c + d);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement