grodek118

From one to parameter

Apr 19th, 2022 (edited)
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1. package com.company;
  2.  
  3.  
  4. public class Main {
  5.  
  6.     public static void main(String[] args) {
  7.  
  8.         printUntiNumber(5);
  9.         }
  10.  
  11.     public static void printUntiNumber (int number) {
  12.  
  13.         for (int i = 1; i <= number; i++) {
  14.             System.out.println(i);
  15.         }
  16.     }
  17. }
  18.  
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment