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
def is_prime_number? number | |
index = 2 | |
tmp = 0 | |
while index <= number | |
if tmp < 1 | |
if (number % index) == 0 | |
tmp += 1 | |
end | |
else | |
return false |
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
#Write a program that asks fro a starting year | |
#and ending year and then put all leap years | |
#between them including them if they are leap years | |
puts "Give me the start year" | |
start_year = gets | |
puts "Give me the end year" | |
end_year = gets |
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
Interactive ruby ready. | |
> help | |
> 2 + 6 | |
=> 8 | |
Success! | |
> 4 * 10 | |
=> 40 | |
> 5 - 12 | |
=> -7 | |
> 40 / 4 |
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
puts("Enter your name:") | |
name = gets | |
puts("Enter your age:") | |
age = gets | |
puts("Enter your address:") | |
address = gets | |
puts name + age + address |
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
Hello Dudes! |
NewerOlder