C Program to Print ‘Hello World’ Without Using Semicolon
23-09-2017
Every beginner starts their learning of a programming language by printing the ‘Hello World’. Do you know in C, you can print ‘Hello World’ without using the semicolon. Printing Hello World without using a semicolon is a common question in c interview questions.
Print ‘Hello World’ Without Using Semicolon
Here I’m explaining three different methods to print the ‘hello world’ without semicolon in C language.
Method 1: Using Switch
void main(){ switch(printf("Hello world")){ } }
Method 2: Using While
void main(){ while(!printf("Hello world")){ } }
Method 3: Using If
void main(){ if(printf("Hello world")){ } }
Tagged in: c interview questions, hello world