Skip to content

Instantly share code, notes, and snippets.

View arrbxr's full-sized avatar
🎯
Focusing

Abhishek Raj Ravi arrbxr

🎯
Focusing
  • Aryabhatta Knowledge University, Bihar
  • Patna India
  • X @arrbxr
View GitHub Profile
@arrbxr
arrbxr / palindrome check.js
Created January 23, 2018 05:21
palindrome check created by arrbxr - https://repl.it/@arrbxr/palindrome-check
function palindrome(str) {
str = str.toLowerCase().replace(/[\w]/g, '');
for(var i = 0, len = str.length - 1; i < len/2; i++) {
if(str[i] !== str[len-i]) {
return false;
}
}
return true;
}
palindrome("ey_e");
class Main {
public static void main(String[] args) {
for(int i=2; i<100; i++){
int count = 1;
for(int j=2; j<i; j++){
if(i%j==0){
count = 0;
break;
}
}
@arrbxr
arrbxr / Largest_no_of_Four_variable.java
Created February 16, 2018 20:54
Largest_no_of_Four_variable created by arrbxr - https://repl.it/@arrbxr/LargestnoofFourvariable
class Main {
public static void main(String[] args) {
int a = 3, b = 6, c = 11, d = 10, e;
e = a>b ? (a>c ? (a>d ? a:d):(c>d ? c:d)):(b>c ? (b>d? b:d):(c>d ? c:d));
System.out.println("Largest Number = " + e);
}
}
@arrbxr
arrbxr / Largest_no_of_Four_variable.java
Created February 16, 2018 20:55
Largest_no_of_Four_variable created by arrbxr - https://repl.it/@arrbxr/LargestnoofFourvariable
class Main {
public static void main(String[] args) {
int a = 3, b = 6, c = 11, d = 10, e;
e = a>b ? (a>c ? (a>d ? a:d):(c>d ? c:d)):(b>c ? (b>d? b:d):(c>d ? c:d));
System.out.println("Largest Number = " + e);
}
}
@arrbxr
arrbxr / To Find Factorial No.c
Created February 18, 2018 08:49
To Find Factorial No created by arrbxr - https://repl.it/@arrbxr/To-Find-Factorial-No
#include "stdio.h"
int main(void) {
int i, num, fac = 1;
printf("Enter Number To find Factorial : ");
scanf("%d", &num);
for(i=1; i<=num; i++){
fac *=i;
}
printf("Factorial = %d", fac);
@arrbxr
arrbxr / factorial.vbp
Created February 18, 2018 16:24
Find Factorial no
private sub Command1_click()
dim i as integer
for i = 1 to 100
if i mod 7 = 0 and i mod 5 <> 0 then
print i
end if
Next
End Sub
// Replace all VOWEL to EXCLAMATION
function vowelReplace(str){
// here we define vowel
var myStr = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'];
// here we convert string to array
var arr = str.split('')
// first loop start
function findNextSquare(sq){
for(var i = 1; i<=sq; i++){
if(i * i == sq){
i++;
return i*i;
}
}
return -1;
}
#include "stdio.h"
int main(void) {
int i = 1, j = 100;
while(j){
printf("%d ", i);
i++;
j--;
}
}
@arrbxr
arrbxr / Check for Palindromes.js
Created February 18, 2018 19:53
Check for Palindromes created by arrbxr - https://repl.it/@arrbxr/Check-for-Palindromes
function palindrome(str){
// assign a front and back pointer
let front = 0;
let back = str.length - 1;
//back and front pointers won't always meet in the middle, so use (back > front)
while(back > front){
while(str[front].match(/[\W_]/)){
//increments front pointer if current character doesn't meet criteria
front++;