1 upto 10

Ruby code posted by Noone
created at 10 Oct 14:54, updated at 10 Oct 19:14

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
int main() {
   int i=1;
   for (;i<10;i++) {
      printf("%d",i);
   }
  return 0;
}

# In Ruby

1.upto (10) do |x|
  printf "%2d\n", x
end
153 Bytes in 4 ms with coderay