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 |
|
#include<stdio.h>
main() {puts("Hello G4EF");} |
|
Contributor
|
|
| 8Sep2009,16:57 | #3 |
|
char*_="Hello G4EF\n";
|
|
~ Б0ЯИ Τ0 С0δЭ ~
|
![]() |
| 8Sep2009,18:45 | #4 |
|
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 |
|
char*_="Hello G4EF";
|
|
Banned
|
|
| 9Sep2009,08:12 | #6 |
|
@ Shabbir,
Are you consider character in file or size of the file ? |
|
Banned
|
|
| 9Sep2009,10:07 | #8 |
|
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 |
|
Hello G4EF
Output of C Program. |
|
Mentor
|
![]() |
| 9Sep2009,14:26 | #10 |
|
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 |




Only 1 char content !

