Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Main {
  3.  
  4.     public static void main(String[] args) {
  5.  
  6.         Scanner keyboard = new Scanner(System.in);
  7.  
  8.         double from = -10;
  9.         double to = 10;
  10.         double by = 0.5;
  11.  
  12.  
  13.         System.out.println("\n X:        Y: ");
  14.         System.out.println("--------------");
  15.  
  16.  
  17.         for (double n = from; n <= to; n = n + by){
  18.             System.out.println( n +  "     "    + n*n);
  19.  
  20.         }
  21.  
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement