Name That Code

What programming language is this?
Min
Max
Question 1 of 12

What programming language is this?

class WorldController < ApplicationController
def hello
  render :text => 'Hello world'
end

  1. C#
  2. Ruby on Rails
  3. Python
  4. C++
  5. Lisp
Question 2 of 12

>>> x = int(raw_input("Please enter an integer: "))
>>> if x < 0:
...      x = 0
...      print 'Negative changed to zero'
... elif x == 0:
...      print 'Zero'
... elif x == 1:
...      print 'Single'
... else:
...      print 'More'

  1. Python
  2. Perl
  3. C
  4. Ruby
Question 3 of 12

class helloworldprog
{  
        public static void main(String args[])
        {
           System.out.println("Hello World!");
        }
}

  1. C++
  2. Pascal
  3. Java
  4. Pike
Question 4 of 12

<? foreach ($list as $key => $value): ?>
<?= $key ?>: <?= $value ?>
<? endforeach; ?>

  1. PHP
  2. Perl
  3. Tk
  4. ASP
Question 5 of 12

#include<stdio.h>
main()
{
  printf("Hello World");
}

  1. .NET
  2. Java
  3. COBOL
  4. C
Question 6 of 12

foreach my $item (@stuff) {
  if ($item =~ /foobar/i) {
    print "$item\n";
  }
}

  1. ASP
  2. Python
  3. Perl
  4. Tcl
  5. Shell
Question 7 of 12

10 PRINT "Hello World!"
20 GOTO 10

  1. C++
  2. Django
  3. Robot C
  4. Basic
  5. LEGOs
Question 8 of 12

<% Response.Write("Hello World!") %>

  1. PHP
  2. ASP
  3. Shell
  4. XML
Question 9 of 12

SELECT id FROM kittens WHERE furry IS NOT NULL;

  1. LOLcode
  2. Basic
  3. Lisp
  4. SQL
Question 10 of 12

1 0 1 0 0 1 1 0 1 1

  1. Fortran
  2. Matlab
  3. Binary
  4. Z++
Question 11 of 12

<address>
1234 somewhere lane <br />
Foobar, TX<br />
</address>
(I know, it's not technically a programming language. Get over it.)

  1. PHP
  2. ASP
  3. HTML
  4. XML
  5. JSP
  6. DHTML
  7. CSS
Question 12 of 12

799 S = FLOATF (IA + IB + IC) / 2.0
AREA = SQRT( S * (S - FLOATF(IA)) * (S - FLOATF(IB)) * +     (S - FLOATF(IC)))
WRITE OUTPUT TAPE 6, 601, IA, IB, IC, AREA
601 FORMAT (4H A= ,I5,5H  B= ,I5,5H  C= ,I5,8H  AREA= ,F10.2, +        13H SQUARE UNITS)
STOP
END

  1. COBOL
  2. Visual Basic
  3. Fortran
  4. C#
  5. Perl