I want to display hello world message in c without using semicolon. how can I do that? Is it possible?
Asked
Active
Viewed 385 times
-1
-
2Why? What is the problem you want to solve by doing that? Is it just curiosity? Please [read about how to ask good questions](http://stackoverflow.com/help/how-to-ask), and also please read about [the XY problem](http://xyproblem.info/). – Some programmer dude Sep 08 '17 at 06:58
-
I first thought of [this one](https://en.wikipedia.org/wiki/Digraphs_and_trigraphs) but unfortunately there is no semicolon :( – izlin Sep 08 '17 at 06:59
-
yeah, I am a beginner at c. just thought this question, that's y I asked. – darlingdon no2 Sep 08 '17 at 07:00
-
1I wonder why teachers give stupid assignments like this. – Jabberwocky Sep 08 '17 at 07:45
-
@michael walz it's not stupid. It gets the student to think of the material they have studied and putting them into use. – machine_1 Sep 08 '17 at 09:38
-
@machine_1 maybe, but there are certainly more productive assignments that teach the students how to do real stuff and not write artificial programs that nobody would ever write in real life. – Jabberwocky Sep 08 '17 at 09:40
2 Answers
5
Yes, It is possible.
#include<stdio.h>
int main(){
if(printf("hello world")){}
}

Jens
- 69,818
- 15
- 125
- 179

Ram Prasad Agarwal
- 265
- 1
- 13
5
There you go!
Solution 1
#include<stdio.h>
int main(){
if(printf("Hello world")){
}
}
Solution 2
#include<stdio.h>
int main(){
while(!printf("Hello world")){
}
}
Solution 3
#include<stdio.h>
int main(){
switch(printf("Hello world")){
}
}
Solution 4
#include<stdio.h>
#define PRINT printf("Hello world")
int main()
{
if(PRINT)
{
}
}