Hello World
Category: Stupid & Funny
Hello World
How the way people code "Hello World" varies depending on their age and job:
High School/Jr.High
10 PRINT "HELLO WORLD"<br />
20 END
20 END
First year in College
program Hello(input, output)<br />
begin<br />
writeln('Hello World')<br />
end.
begin<br />
writeln('Hello World')<br />
end.
Senior year in College
(defun hello<br />
(print<br />
(cons 'Hello (list 'World))))
(print<br />
(cons 'Hello (list 'World))))
New professional
#include <stdio.h><br />
<br />
void main(void)<br />
{<br />
char *message[] = {"Hello ", "World"};<br />
int i;<br />
for(i = 0; i < 2; ++i)<br />
printf("%s", message[i]);<br />
printf("\n");<br />
}
<br />
void main(void)<br />
{<br />
char *message[] = {"Hello ", "World"};<br />
int i;<br />
for(i = 0; i < 2; ++i)<br />
printf("%s", message[i]);<br />
printf("\n");<br />
}
Seasoned professional
#include <iostream.h><br />
#include <string.h><br />
class string<br />
{<br />
private:<br />
int size;<br />
char *ptr;<br />
public:<br />
string() : size(0), ptr(new char('\0')) {}<br />
string(const string &s) : size(s.size)<br />
{<br />
ptr = new char[size + 1];<br />
strcpy(ptr, s.ptr);<br />
}<br />
~string()<br />
{<br />
delete [] ptr;<br />
}<br />
friend ostream &operator <<(ostream &, const string &);<br />
string &operator=(const char *);<br />
};<br />
<br />
ostream &operator<<(ostream &stream, const string &s)<br />
{<br />
return(stream << s.ptr);<br />
}<br />
string &string::operator=(const char *chrs)<br />
{<br />
if (this != &chrs)<br />
{<br />
delete [] ptr;<br />
size = strlen(chrs);<br />
ptr = new char[size + 1];<br />
strcpy(ptr, chrs);<br />
}<br />
return(*this);<br />
}<br />
int main()<br />
{<br />
string str;<br />
str = "Hello World";<br />
cout << str << endl;<br />
return(0);<br />
}
#include <string.h><br />
class string<br />
{<br />
private:<br />
int size;<br />
char *ptr;<br />
public:<br />
string() : size(0), ptr(new char('\0')) {}<br />
string(const string &s) : size(s.size)<br />
{<br />
ptr = new char[size + 1];<br />
strcpy(ptr, s.ptr);<br />
}<br />
~string()<br />
{<br />
delete [] ptr;<br />
}<br />
friend ostream &operator <<(ostream &, const string &);<br />
string &operator=(const char *);<br />
};<br />
<br />
ostream &operator<<(ostream &stream, const string &s)<br />
{<br />
return(stream << s.ptr);<br />
}<br />
string &string::operator=(const char *chrs)<br />
{<br />
if (this != &chrs)<br />
{<br />
delete [] ptr;<br />
size = strlen(chrs);<br />
ptr = new char[size + 1];<br />
strcpy(ptr, chrs);<br />
}<br />
return(*this);<br />
}<br />
int main()<br />
{<br />
string str;<br />
str = "Hello World";<br />
cout << str << endl;<br />
return(0);<br />
}
System Administrator
#include <stdio.h><br />
#include <stdlib.h><br />
main()<br />
{<br />
char *tmp;<br />
int i=0;<br />
/* on y va bourin */<br />
tmp=(char *)malloc(1024*sizeof(char));<br />
while (tmp[i]="Hello Wolrd"[i++]);<br />
/* Ooopps y'a une infusion ! */<br />
i=(int)tmp[8];<br />
tmp[8]=tmp[9];<br />
tmp[9]=(char)i;<br />
printf("%s\n",tmp);<br />
}
#include <stdlib.h><br />
main()<br />
{<br />
char *tmp;<br />
int i=0;<br />
/* on y va bourin */<br />
tmp=(char *)malloc(1024*sizeof(char));<br />
while (tmp[i]="Hello Wolrd"[i++]);<br />
/* Ooopps y'a une infusion ! */<br />
i=(int)tmp[8];<br />
tmp[8]=tmp[9];<br />
tmp[9]=(char)i;<br />
printf("%s\n",tmp);<br />
}
Apprentice Hacker
#!/usr/local/bin/perl<br />
$msg="Hello, world.\n";<br />
if ($#ARGV >= 0) {<br />
while(defined($arg=shift(@ARGV))) {<br />
$outfilename = $arg;<br />
open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n";<br />
print (FILE $msg);<br />
close(FILE) || die "Can't close $arg: $!\n";<br />
}<br />
} else {<br />
print ($msg);<br />
}<br />
1;
$msg="Hello, world.\n";<br />
if ($#ARGV >= 0) {<br />
while(defined($arg=shift(@ARGV))) {<br />
$outfilename = $arg;<br />
open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n";<br />
print (FILE $msg);<br />
close(FILE) || die "Can't close $arg: $!\n";<br />
}<br />
} else {<br />
print ($msg);<br />
}<br />
1;
Experienced Hacker
#include <stdio.h><br />
#include <string.h><br />
#define S "Hello, World\n"<br />
main(){exit(printf(S) == strlen(S) ? 0 : 1);}
#include <string.h><br />
#define S "Hello, World\n"<br />
main(){exit(printf(S) == strlen(S) ? 0 : 1);}
Seasoned Hacker
% cc -o a.out ~/src/misc/hw/hw.c<br />
% a.out<br />
Hello, world.
% a.out<br />
Hello, world.
Guru Hacker
% cat<br />
Hello, world.
Hello, world.
New Manager (do you remember?)
10 PRINT "HELLO WORLD"<br />
20 END
20 END
Middle Manager
mail -s "Hello, world." bob@b12<br />
Bob, could you please write me a program that prints "Hello, world."?<br />
I need it by tomorrow.<br />
^D
Bob, could you please write me a program that prints "Hello, world."?<br />
I need it by tomorrow.<br />
^D
Senior Manager
% zmail jim<br />
I need a "Hello, world." program by this afternoon.
I need a "Hello, world." program by this afternoon.
Chief Executive
% letter<br />
letter: Command not found.<br />
% mail<br />
To: ^X ^F ^C<br />
% help mail<br />
help: Command not found.<br />
% damn!<br />
!: Event unrecognized<br />
% logout
letter: Command not found.<br />
% mail<br />
To: ^X ^F ^C<br />
% help mail<br />
help: Command not found.<br />
% damn!<br />
!: Event unrecognized<br />
% logout
Research Scientist
PROGRAM HELLO<br />
PRINT *, 'Hello World'<br />
END
PRINT *, 'Hello World'<br />
END
Older research Scientist
WRITE (6, 100)<br />
100 FORMAT (1H ,11HHELLO WORLD)<br />
CALL EXIT<br />
END
100 FORMAT (1H ,11HHELLO WORLD)<br />
CALL EXIT<br />
END
Read more:
Dear Guest, you are still unregistered user. We recommend you to register or log in under your name. Mocii is social blog, where you create and discover articles, tips, posts, questions, knowledge, experience, guides about everything, rate all posts, where you can submit linked posts from your blogs to promote whem and it is good place to communicate with other mocii users. Mocii is in 'Beta' now, feel free to join!
Top Rated Posts:
» Powered by Intel Atom and finally redesigned MIU HDPC
» Motorola Aura Preview
» Top 10 of the most useful apps for Android phone
» MSI Wind 2 Netbook, November Release
» Finally Android open-source code for you
» Motorola Aura Preview
» Top 10 of the most useful apps for Android phone
» MSI Wind 2 Netbook, November Release
» Finally Android open-source code for you
Recent Posts:
» Prada Link - Watch for Prada 2 phone
» The iCEphone
» Touchgrind. App Store. November
» iTalk - Free Recorder for iPhone
» Motorola Aura Preview
» The iCEphone
» Touchgrind. App Store. November
» iTalk - Free Recorder for iPhone
» Motorola Aura Preview
|



