Closed ErSKS closed 7 years ago
package patternmore2;
/*
@author Jagdish Duwal */ public class PatternMore2 {
/**
@param args the command line arguments */ public static void main(String[] args) {
int i=0,x=2; do{ x--; int j = 0; do{
System.out.print(x + " ");
j++;
x++;
}while(j<2); System.out.println(); i++; }while(i<4);
}
}
/*
import javax.swing.JOptionPane;
/*
@author mahesh */ public class NewPatterns {
/**
@param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here String p = "123456789"; String rows = JOptionPane.showInputDialog("Enter No of Rows:"); int i = 1; do { System.out.println(i + " " + (i + 1)); //JOptionPane.showMessageDialog(null, i + " " + (i + 1) + "\n"); i++;
} while (i <= Integer.parseInt(rows))
}
}
/*
/*
@author Kiran */ public class Pattern25 {
/**
Output:
package pattern24;
import java.util.Scanner;
/*
@author m-lan */ public class Pattern24 {
/**
}
/*
/*
@author DELL */ public class Pattern23 {
/**
OUTPUT
/*
/*
@author Anish */ public class Pattern24 {
/**
}
/*
import java.util.Scanner;
/*
@author LORDsajan */ public class Pattern24 {
/**
}
}
/*
import java.util.Scanner;
/*
@author Dragon15423 */ public class Day10Patterns {
/**
@param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here
Scanner input = new Scanner(System.in);
System.out.println("Enter the length of pattern: ");
int in = input.nextInt();
int a = 1;
for (int i = 0; i < in; i++) {
for (int j = 1; j <= 2; j++) {
System.out.print(i + j + " ");
}
System.out.println("");
}
}
}
/*
import java.util.Scanner;
/*
@author Dell */ public class Pattern24 {
/**
}
}
/*
import java.util.Scanner;
/*
@author kajal */ public class Pattern24 {
/**
}
/*
/*
@author Kishorr */ public class JavaApplication80 {
/**
}
/*
/*
@author Amrit */ public class Pattern24 {
/**
@param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here int j=2; for (int i = 1; i < 5; i++) { System.out.print(i+" "+j+"\n"); j++;
} }
}
/*
/*
@author dell */ public class TaskFour {
public static void main(String[] args) { int c, j; int i = 1; do { j = 1; do { c = (i + j); System.out.print(i + " " + c + " "); j++;
} while (j < 2);
System.out.println(" ");
i++;
} while (i < 4);
} }
/*
/*
@author nissus */ public class P24 {
/**
int i = 0, x = 2; do { x--; int j = 0; do {
System.out.print(x + " ");
j++;
x++;
} while (j < 2);
System.out.println();
i++;
} while (i < 4);
}
}
package patt24;
import java.util.Scanner;
/*
@author ragen */ public class Patt24 {
/**
Scanner input = new Scanner(System.in);
System.out.println("Enter the length of pattern: ");
int inp = input.nextInt();
int a = 1;
for (int i = 0; i < inp; i++) {
for (int j = 1; j <= 2; j++) {
System.out.print(i + j + " ");
} System.out.println();
}
} }
package day09pattern24;
/*
@author Samikshya */ public class Day09Pattern24 {
/**
}
}
package day9pattern24;
import static java.lang.Integer.parseInt; import javax.swing.JOptionPane;
/*
@author DELL */ public class Day9pattern24 {
/**
@param args the command line arguments */ // TODO code application logic here public static void main(String[] args) { String c = "", b; int n = parseInt(JOptionPane.showInputDialog("Enter the number of row")); int m = parseInt(JOptionPane.showInputDialog("Enter the number of column")); int i = 0;
do { b = " "; int j = 1; do {
int a = j + i;
b = b + a + " ";
j++;
} while (j <= m);
c = c + b + "\n";
i++;
} while (i < n); JOptionPane.showMessageDialog(null, c, "Pattern 23", 1);
} }
/*
import java.util.Scanner;
/*
@author admin */ public class Pattern24 {
/**
}
package patterntwentyfour;
/*
@author User */ public class PatternTwentyFour {
/**
} }
/*
/*
@author sarumdr */ public class Pattern25 {
/**
// TODO code application logic here int i = 0, j = 1;
do {
do {
System.out.print(i + j + " ");
j++;
} while (j < 3);
System.out.println(" ");
i++;
j = 1;
} while (i <= 3);
}
}
OUTPUT
public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Enter value for Row and Column"); int a = input.nextInt(); int b = input.nextInt(); int i = 0; do { int j = 1; do { System.out.print(i + j + " "); j++; } while (j <= b); System.out.println(""); i++; } while (i < a); } }
CODE: package pattern24;
/*
@author User */ public class Pattern24 {
/**
public class Day9Ass1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("enter n:");
int n = in.nextInt();
for (int i = 1; i < n; i++) {
for (int j = 1; j < 3; j++) {
System.out.printf("%d ", i + j - 1);
}
System.out.println("");
}
}
}
// TODO code application logic here }
}
/*
import java.util.Scanner;
/*
@author Lenovo */ public class PatternNo24 {
/**
}