Here is my code sample:
for $i(1..100){
if ($i%15==0){$s="Divisible by 15"}
elsif($i%5==0){$s="Divisible by 5"}
else {$i%3==0 ? $s="Divisible by 3" : $s=$i};
print $s."\n"}
This displays partial correct results, if a number if divisible by 3, it displays the "number" and not "Divisible by 3".
Example of output:
1
2
3
4
Divisible by 5
6
7
8
9
Divisible by 5
PS: I have to write this code in the minimum no. of characters possible. (The reason why the code is so sluggish)