# Forum: Ruby Ruby multiplication

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
on 2017-03-13 10:44
```Sorry if I'm in the incorrect forum, but I'm new here :)

I would need a function "multiplication" which returns the product of
her parametres "a" and "b".

on 2017-03-13 11:40
```Mi Gatt wrote in post #1185675:
> Sorry if I'm in the incorrect forum, but I'm new here :)
>
> I would need a function "multiplication" which returns the product of
> her parametres "a" and "b".
>
> Can anybody help me please?

def mult(a,b)
res=0
while true
return(res) if b<=0
res=res+a
b=b-1
end
end
p mult 7,7```
on 2017-03-13 13:10
```def add(a,b)
sa='-'*a
sb='-'*b
return "#{sa}#{sb}".size
end```
on 2017-03-13 15:55
`Thanks that helped me!!`
on 2017-03-14 07:00
```def multiplication(a,b)
a*b
end```
on 2017-03-14 07:01
```Regis d'Aubarede wrote in post #1185677:
>   sa='-'*a
>   sb='-'*b
>   return "#{sa}#{sb}".size
> end

Ah, I *love* this. This is by far the best answer to the question.```
on 2017-03-17 12:33
```Ronald Fischer wrote in post #1185684:
> Ah, I *love* this. This is by far the best answer to the question.

==
def n(a) '-'*a  end
def s(a) a.size end

def mult(a,b)
res=''
loop {
return(res)  if b==''