> ## Content Index
> Fetch the complete content index at: https://developerinsider.co/llms.txt
> Use this file to discover other available public pages before exploring further.

# C Program to print "hello world" without semicolon - Programming Puzzles
- URL: https://developerinsider.co/c-program-to-print-hello-without-semicolon/
- Published: 2016-10-17T17:39:17.000Z
- Updated: 2018-03-29T17:01:15.000Z
- Author: Vineet Choudhary
- Tags: Programming Puzzles, Puzzles

We can print "hello world" or anything else in C without using semicolon. There are various ways to do so:

1. Using if
2. Using switch
3. Using while loop etc.

## 1\. Using if

Let's see a simple c example to print "hello world" using if statement and without using semicolon.

```c
#include<stdio.h>  
void main(){  
   if(printf("hello world")){}  
}  

```

**Output:**

```
hello world

```

## 2\. Using switch

Let's see a simple c example to print "hello world" using switch statement and without using semicolon.

```c
#include<stdio.h>  
void main(){  
   switch(printf("hello world")){}  
}  

```

**Output:**

```
hello world

```

## 3\. Using while loop

Let's see a simple c example to print "hello world" using while loop and without using semicolon.

```c
#include<stdio.h>  
void main(){  
   while(!printf("hello world")){}  
}  

```

**Output:**

```
hello world

```