hello world
C
Hello World — By different types of programmers
# source: https://www.smart-jokes.org/programmer-evolution.html
High School / Junior High
10 PRINT "HELLO WORLD"
20 END
First Year in College
program Hello(input, output)
begin
writeln('Hello World')
end.
Senior Year in College
(defun hello
(print
(cons 'Hello (list 'World))))
New professional
#include
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}
Seasoned professional
#include <iostream.h>
#include <string.h>
class string
{
private:
int size;
char *ptr;
public:
string() : size(0), ptr(new char('\0')) {}
string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}
~string()
{
delete [] ptr;
}
friend ostream &operator <<(ostream &, const string &);
string &operator=(const char *);
};
ostream &operator <<(ostream &stream, const string &s)
{
return(stream << s.ptr);
}
string &string::operator=(const char *chrs)
{
if (this != &chrs)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
}
return(*this);
}
int main()
{
string str;
str = "Hello World";
cout << str << endl;
return(0);
}
Apprentice Hacker
#!/usr/local/bin/perl
$msg="Hello, world.\n";
if ($#ARGV >= 0) {
while(defined($arg=shift(@ARGV))) {
$outfilename = $arg;
open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n";
print (FILE $msg);
close(FILE) || die "Can't close $arg: $!\n";
}
}
else {
print ($msg);
}
1;
Experienced Hacker
#include <stdio.h>
#define S "Hello, World\n"
main(){exit(printf(S) == strlen(S) ? 0 : 1);}
Seasoned Hacker
% cc -o a.out ~/src/misc/hw/hw.c
% a.out
Guru Hacker
% cat
Hello, world.
^D
Junior Manager
10 PRINT "HELLO WORLD"
20 END
Middle Manager
mail -s "Hello, world." bob@b12
Bob, could you please write me a program that prints "Hello, world."?
I need it by tomorrow.
^D
Senior Manager
% zmail jim
I need a "Hello, world." program by this afternoon.
Chief Executive
% letter
letter: Command not found.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout//This is a simple Hello World program.
public class hello world {
public static void main(Strin[] args) {
System.out.println("Hello World");
}
}Yes.# simple python Hello World program:
print('hello world')
# or, more exclusive:
def say_hello_to_the_world():
print('hello world')
def main():
say_hello_to_the_world()
main()//This is a simple Hello World program.
public class hello world {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Also in C:
- Title
- how to get random numbers in c
- Category
- C
- Title
- c hello world
- Category
- C
- Title
- vbl share price
- Category
- C
- Title
- CL/cl.h: No such file or directory
- Category
- C
- Title
- version of libgcc
- Category
- C
- Title
- generate all permutations of string
- Category
- C
- Title
- boolean function c
- Category
- C
- Title
- c print array
- Category
- C
- Title
- what is conio.h
- Category
- C
- Title
- oop244
- Category
- C
- Title
- how to get user input in c
- Category
- C
- Title
- command line arguments c
- Category
- C
- Title
- how to login to another user in powershell
- Category
- C
- Title
- 'int' is not a subtype of type 'double' dart
- Category
- C
- Title
- ModuleNotFoundError: No module named 'easydict'
- Category
- C
- Title
- disable gnu++11 option
- Category
- C
- Title
- how to pass an array value to a pthread in c
- Category
- C
- Title
- add border to image android
- Category
- C
- Title
- mangoosejs
- Category
- C
- Title
- time now c
- Category
- C
- Title
- azure storage emulator config
- Category
- C
- Title
- buscar caracter
- Category
- C
- Title
- char to int c
- Category
- C
- Title
- hello world
- Category
- C
- Title
- where is my vimrc
- Category
- C
- Title
- maximo comun divisor
- Category
- C
- Title
- error 403
- Category
- C
- Title
- c print hello world
- Category
- C
- Title
- bella ciao lyrics
- Category
- C
- Title
- c vs python
- Category
- C
- Title
- how to make a linked list in c
- Category
- C
- Title
- strrev in c
- Category
- C
- Title
- how to change the mapping from jkil to wasd in vim
- Category
- C
- Title
- array length c
- Category
- C
- Title
- tkinter create_line
- Category
- C
- Title
- how to check the size of a file c
- Category
- C
- Title
- write array of char to file in c
- Category
- C
- Title
- calculate max of three numbers using ternary operator in c
- Category
- C
- Title
- powershell list big files
- Category
- C
- Title
- code wars responsable drinker
- Category
- C
- Title
- append to list in c
- Category
- C
- Title
- stack
- Category
- C
- Title
- too few arguments to function in c
- Category
- C
- Title
- c printf uint32_t
- Category
- C
- Title
- declare variable in c
- Category
- C
- Title
- docker run port mapping
- Category
- C
- Title
- what are the causes of memory leaks in c
- Category
- C
- Title
- arduino digital input pins
- Category
- C
- Title
- left me on read
- Category
- C
- Title
- inurl:fiu.edu math faculty
- Category
- C
- Title
- how to sleep in c
- Category
- C
- Title
- powershell search big files
- Category
- C
- Title
- how to do matrix multiplication in c
- Category
- C
- Title
- scanf read line
- Category
- C
- Title
- c list
- Category
- C
- Title
- what is stdin in c
- Category
- C
- Title
- ordenar un vector
- Category
- C
- Title
- read from stdin c
- Category
- C
- Title
- potencia recursiva
- Category
- C
- Title
- switch case c
- Category
- C
- Title
- last element from list javascript
- Category
- C
- Title
- slurm array job
- Category
- C
- Title
- csrf_exempt
- Category
- C
- Title
- turn a char array into double C
- Category
- C
- Title
- multiplication in c
- Category
- C
- Title
- download file by command line windows
- Category
- C
- Title
- c copy string
- Category
- C
- Title
- get_session` is not available when using TensorFlow 2.0.
- Category
- C
- Title
- program using if statement in c whether numnber is less eqaul to greater than 50
- Category
- C
- Title
- java.lang.SecurityException: Permission denied (missing INTERNET permission?)
- Category
- C
- Title
- cantidad de digitos recursiva
- Category
- C
- Title
- passing 'const char *' to parameter of type 'char *' discards qualifiers
- Category
- C
- Title
- remove element queue
- Category
- C
- Title
- curl post request
- Category
- C
- Title
- how to pass an array to a thread in c?
- Category
- C
- Title
- Couldn't create temporary file to work with
- Category
- C
- Title
- conda windows 10 from pip._internal.cli.main import main ModuleNotFoundError
- Category
- C
- Title
- matplotlib plot circle marker
- Category
- C
- Title
- error: ‘cout’ was not declared in this scope
- Category
- C
- Title
- ‘uint64_t’ was not declared in this scope
- Category
- C
- Title
- multiplication operator in c
- Category
- C
- Title
- how to find the ith row of pascal's triangle in c
- Category
- C
- Title
- read a document in c getting name from console
- Category
- C
- Title
- how to only show tenths place in c
- Category
- C
- Title
- code: 'EADDRINUSE', [0] errno: 'EADDRINUSE', [0] syscall: 'listen', [0] address: '::', [0] port: 5000
- Category
- C
- Title
- c how to define a variable
- Category
- C
- Title
- how can i remove a specific item from an array
- Category
- C
- Title
- does strcat null terminate
- Category
- C
- Title
- limit of integer in c
- Category
- C
- Title
- docker pull command
- Category
- C
- Title
- enum c
- Category
- C
- Title
- how to globally initlailize a struct
- Category
- C
- Title
- allocate memory c
- Category
- C
- Title
- printf("%3d ",XX);
- Category
- C
- Title
- c bit access union
- Category
- C
- Title
- how to remove button decoration
- Category
- C
- Title
- diferencia entre * y & en c
- Category
- C
- Title
- File "h5py\h5g.pyx", line 161, in h5py.h5g.create ValueError: Unable to create group (name already exists)
- Category
- C
- Title
- how to print a file c
- Category
- C
- Title
- FILE*
- Category
- C