Advertisement
MrDoyle

5) For Loops

Jan 14th, 2021
665
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. public class Main {
  2.  
  3.     public static void main(String[]args){
  4.  
  5.         for(int i = 0; i < 5; i++){
  6.             System.out.println("The value of i is: " + i);
  7.         }
  8.  
  9.         System.out.println();
  10.        
  11.         for(int j = 0; j < 5; j++){
  12.             System.out.printf("The value of j is: %d\n" , j);
  13.         }
  14.     }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement