Skip to content

Instantly share code, notes, and snippets.

View rushmedev's full-sized avatar
🎯
Focusing on React

rushmedev rushmedev

🎯
Focusing on React
View GitHub Profile
@rushmedev
rushmedev / dev.svg
Created November 28, 2020 06:49
Developer SVG image
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import java.util.Scanner;
public class Prime_number {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number to check prime or not:");
int number = sc.nextInt();
if(number != 0) {
System.out.println("The number " + number + " is " + PrimeCheck(number));
}
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]);
}
}
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;
@rushmedev
rushmedev / Star_num.java
Created December 21, 2017 17:19
Pattern Program
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) {
@rushmedev
rushmedev / done.java
Last active December 9, 2017 14:12
Question.
public class done {
public static void main(String[] args) {
String input = "jjjjjaaaaasssspppeeerrrrr";
System.out.println(input.replaceAll("(.)\\1{1,}", "$1"));
}
}
//Output
jasper