Shortest Hello G4EF | 8 Sep 2009

shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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
Mridula's Avatar, Join Date: Mar 2008
Pro contributor
#include<stdio.h>
main()
{puts("Hello G4EF");}
Kshiteej's Avatar, Join Date: Jul 2009
Contributor
char*_="Hello G4EF\n";
SaswatPadhi's Avatar, Join Date: May 2009
~ Б0ЯИ Τ0 С0δЭ ~
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.
Seema786's Avatar
Banned
char*_="Hello G4EF";
naimish's Avatar
Banned
@ Shabbir,

Are you consider character in file or size of the file ?
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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
naimish's Avatar
Banned
1. Charater

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

Total Character = 48

2.

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

Save It = 4 KB
Raj08's Avatar
Banned
Hello G4EF

Output of C Program.
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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?