Advertisement
Huntersazzad

lab2

Oct 29th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.89 KB | None | 0 0
  1. package TEST;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class TEST1 {
  6.  
  7.     public static void main(String[] args) {
  8.         // TODO Auto-generated method stub
  9.  
  10.         System.out.println("enter a number:");
  11.         Scanner num=new Scanner(System.in);
  12.         int i,n;
  13.         n=num.nextInt();
  14.         for(i=1;i<n;i++) {
  15.             if(n%i==0) {
  16.             System.out.println(+ i);
  17.             }
  18.         }
  19.        
  20.        
  21.        
  22.             int  num=5 ;
  23.         int  j=10;
  24.         for(int r=1;r<=5;r++) {
  25.             for(int c=1; c<=10;c++ ) {
  26.                 int sum=r*c;                 System.out.printf("%d x %d =%d \n ",r,c,sum);
  27.                
  28. //          }
  29. //
  30. //          System.out.printf("\n");
  31. //
  32. //  }
  33.        
  34. //              System.out.println("enter the number:");
  35. //      Scanner num=new Scanner(System.in);
  36. //      int n,i,c=0;
  37. //      n=num.nextInt();
  38. //      for(i=1;i<=n;i++) {
  39. //          //for(j=1;j<=i;j++) {
  40. //              if(n%i==0)
  41. //          c++;
  42. //         
  43. //      }
  44. //          if(c==2)
  45. //              System.out.println("prime");
  46. //          else
  47. //              System.out.println("No");
  48.            
  49.     }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement