Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test{ | |
public static void main(String[] args) { | |
int[] a = new int[10]; | |
for (int i = 0;i<10 ;i++ ) { | |
a[i] = i+1; | |
} | |
for (int i=0;i<10 ;i++ ) { | |
System.out.println(a[i]); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Nacre_Reverse { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Enter the string to reverse:"); | |
String str1 = sc.nextLine(); | |
String st = str1.concat(" "); | |
int a = 0; | |
int temp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
class Star_num { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
System.out.println("Enter number of rows and columns: "); | |
int n = scn.nextInt(); | |
for (int i = 1; i <= n; i++) { | |
for (int j = n; j >= 1; j--) { | |
if (j > i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class done { | |
public static void main(String[] args) { | |
String input = "jjjjjaaaaasssspppeeerrrrr"; | |
System.out.println(input.replaceAll("(.)\\1{1,}", "$1")); | |
} | |
} | |
//Output | |
jasper |