-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.rb
More file actions
58 lines (42 loc) · 803 Bytes
/
functions.rb
File metadata and controls
58 lines (42 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
def sayhi
puts "Hello User"
print "Hello User"
print "Hello User"
end
sayhi
def Sayhi(name, age)
puts("Hello " + name + ", you are " + age.to_s + " years old!")
end
Sayhi("Steve", 80)
Sayhi("Sarina", 13)
def addition(num1, num2)
subtract = num1-num2
puts(subtract)
end
addition(12, 8)
#Subtraction
#Division
#Mulitiplication
def subtraction(num1,num2)
subtract=num1-num2
puts(subtract)
end
subtraction(9, 7)
def division(num1/num2)
divide=num1/num2
puts(num1/num2)
end
def multiplication(num1*num2)
multiply=num1*num1
puts(num1*num2)
def hello(name)
puts "Hello " + name
end
hello("Faith")
def pd(no1, no2)
multiply = no1.to_i * no2.to_i
difference = no1.to_i - no2.to_i
puts(multiply)
puts(difference)
end
pd(5, 2)