Advertisement
CamiloCastilla

Untitled

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