Advertisement
MrDoyle

For) Counting by Halves

Nov 13th, 2020
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. public class Main {
  2.  
  3.     public static void main(String[] args) {
  4.         System.out.println(" x ");
  5.         System.out.println("-----");
  6.         double x = -10;
  7.  
  8.         for (x = x ; x <= 10 ; x = x + 0.5){
  9.             System.out.println(x + " ");
  10.         }
  11.     }
  12. }
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement