Shortest Hello G4EF | 8 Sep 2009

Go4Expert Founder
8Sep2009,16:46   #1
shabbir's Avatar
Write a C Program which has least number of characters and prints "Hello G4EF" without quotes.

This is not first submission winner but would wait for all submission and then the shortest would win.
Criteria would be least number of characters and it should be a C Program
Pro contributor
8Sep2009,16:55   #2
Mridula's Avatar
#include<stdio.h>
main()
{puts("Hello G4EF");}
Contributor
8Sep2009,16:57   #3
Kshiteej's Avatar
char*_="Hello G4EF\n";
~ Б0ЯИ Τ0 С0δЭ ~
8Sep2009,18:45   #4
SaswatPadhi's Avatar
I googled and found this as the shortest possible. As, the source file is only 1 byte !

Steps :
(1) Create a new empty file named : "void main(){puts(Hello, World!);}c.c"
(2) Open the file with any text editor and write only one char "A" to the file and save it.
##That's our program Only 1 char content !
(3) To compile it, use gcc with flags "-DA=__FILE__ -Dc=// -istdio.h void*.c".

Not sure if it works. I'll test and post.
Banned
9Sep2009,07:54   #5
Seema786's Avatar
char*_="Hello G4EF";
Banned
9Sep2009,08:12   #6
naimish's Avatar
@ Shabbir,

Are you consider character in file or size of the file ?
Go4Expert Founder
9Sep2009,09:26   #7
shabbir's Avatar
Quote:
Originally Posted by naimish View Post
@ Shabbir,

Are you consider character in file or size of the file ?
Can you explain the difference.
naimish like this
Banned
9Sep2009,10:07   #8
naimish's Avatar
1. Charater

#include<stdio.h>
main()
{puts("Hello G4EF");}

Total Character = 48

2.

#include<stdio.h>
main()
{puts("Hello G4EF");}

Save It = 4 KB
Banned
9Sep2009,11:19   #9
Raj08's Avatar
Hello G4EF

Output of C Program.
Mentor
9Sep2009,14:26   #10
xpi0t0s's Avatar
Quote:
Originally Posted by naimish View Post
Save It = 4 KB
That's because the file is stored in blocks, and the smallest block size is 4KB. Select the file and press Alt-Enter and you'll see the actual file size displayed.

Quote:
Originally Posted by Raj08
Output of C Program.
Very good. And what is the source code of that C program? It's true Shabbir didn't actually say "and post the code here", but that could reasonably be implied, also how is he going to judge your code if he can't see it?