Advertisement
yanivtamari

ex 26.05 1

May 26th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner s=new Scanner(System.in);
  7.         int num;
  8.         num=s.nextInt();
  9.         for(int i=1,j=1;i<=num;j++,i=j*j){
  10.         System.out.printf("the value:%d,the result:%d\n",j,i);
  11.  
  12.         }
  13.  
  14.  
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement