Skip to content

Instantly share code, notes, and snippets.

@shankar524
shankar524 / prime_number.rb
Last active January 24, 2019 04:23
This ruby program finds the input number is prime or not.
# this function finds if a number is prime or not
def is_prime_number(number=0)
# value to store if a number is prime or not
# initailly assumed prime
is_prime=true
#iterate from 2 till half of that number
for num in 2..(number+1)/2
@shankar524
shankar524 / happy_number.rb
Last active January 24, 2019 05:23
This program finds if a number is a happy number or not.
#this function squares a number
def square(number)
number**2
end
#this function breaks a number into its subsequent array
def break_number_to_arr(number)
return [0] if number.zero?
return_arr=[]
@shankar524
shankar524 / curious_number.rb
Created January 24, 2019 10:38
Curious Number A n-digit number is said to be curious if the last n digits of its square are the same as the original number. For example, 25^2 = 625 and 76^2 = 5776. (Curious numbers are also known as automorphic numbers.) An example of 9 digit number: 212890625^2 = 45322418212890625 Write a program to find all Curious Numbers of 1 to 10 digits.
def square(number=0)
number ** 2
end
def is_curious_number(number)
diff = square(number) - number
last_digits=diff % (10**(number.digits.count))
if(last_digits==0)
return true
else

Congratulations! You are a speaker at the tech conference!

This guide will help you out with preparing your best talk yet.
Tip: this file has outline for your convenience (Press Ctrl+cmd+H on Mac or Ctrl+Alt+H for other OS)

How to choose what you will be talking about

Be passionate about your topic. Make sure that your topic is the most exciting, interesting, compelling thing in the universe.

Standard slides

Title slide

Create a visually engaging title page so the audience is interested and ready to listen before you begin speaking.

@shankar524
shankar524 / palindromeTree.go
Last active January 29, 2020 06:11
Following program will print pallindrome tree from provided input number by asking user input.
/*
Following program will print pallindrome tree
from provided input number by asking user input.
A sample program outpust like:-
Enter any number:
9
1
212
package com.cf.pm;
import java.util.Arrays;
import java.util.List;
import java.util.stream.*;
import java.util.Random;
public class HelloWorld{
public static void main(String[] args) {