addition 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/addition.rb +19 -13
- data/lib/addition/version.rb +1 -1
- metadata +1 -1
data/lib/addition.rb
CHANGED
@@ -2,19 +2,25 @@ $: << File.dirname(__FILE__)
|
|
2
2
|
require "addition/version"
|
3
3
|
|
4
4
|
module Addition
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
class A
|
6
|
+
puts "Enter first no."
|
7
|
+
$x=gets
|
8
|
+
puts"Enter second no."
|
9
|
+
$y=gets
|
10
|
+
$a=$x.to_i
|
11
|
+
$b=$y.to_i
|
12
|
+
$c
|
13
|
+
def add()
|
14
|
+
$c=$a+$b
|
15
|
+
puts "the sum is #{$c}"
|
16
|
+
end
|
17
|
+
def mul()
|
18
|
+
$c=$a*$b
|
19
|
+
puts"the multiplication result is\n #{$c}"
|
20
|
+
end
|
16
21
|
end
|
17
22
|
|
18
|
-
|
19
|
-
|
23
|
+
v=A.new
|
24
|
+
v.add
|
25
|
+
v.mul
|
20
26
|
end
|
data/lib/addition/version.rb
CHANGED