Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
is this possible in c language to print the "hello world" message. without using any semicolon in the program.
if it is then how?
Posted
Updated 2-Oct-13 19:22pm
v2
Comments
[no name] 3-Oct-13 1:04am    
Hello Google.
Sergey Alexandrovich Kryukov 3-Oct-13 1:07am    
Off-topic. This is a forum for software developers, including students.
—SA

1 solution

Yes.


Through the use of the magical pre-processor; that which makes C so powerful and dangerous.

C:\JBUTIL>type nosemi.c
int main() { printf ( "Hello world" ) SEMI }

C:\JBUTIL>gcc -include stdio.h -oNoSemi.exe -DSEMI=;  NoSemi.c

C:\JBUTIL>nosemi
Hello world
C:\JBUTIL>



Possible, but not recommended.


Or you can go whole hog...

C:\JBUTIL>type badc.c
This program will say "Hello world" and then end

C:\JBUTIL> gcc -include stdio.h -oBadC.exe -DThis=int -Dprogram=main() -Dwill={ -Dsay=printf( -Dand=) -Dthen=; -Dend=} BadC.c

C:\JBUTIL>BadC.exe
Hello world
C:\JBUTIL>
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900