
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
C Program to print âHello World!â without using a semicolon
Let us see how to write a C program in which we can print the text “Hello World” without using any semicolon.
We can simply write the text by using the line printf(“Hello World”); in the main() function.
But there is a semicolon at the end of the line. To avoid the semicolon, we can follow some trick. We can use the same printf() statement inside if condition. As the printf() statement returns the length of the text, so it is non zero value, so the if statement will be true. Thus the text will be written on screen.
Example Code
#include<stdio.h> main() { if(printf("Hello World")) { } }
Output
Hello World
- Related Articles
- Print Hello World without semicolon in C++
- Print âHello Worldâ in C/C++ without using header files
- Print âHello Worldâ without using any header file in C
- How to print a semicolon(;) without using semicolon in C/C++?
- Python Program to Print Hello world
- Swift program to print Hello World!
- Haskell Program to print Hello World!
- Write a C program to print â Tutorials Point â without using a semicolon
- How to print "Hello World!" using Python?
- Write a program to print âTutorials Pointâ without using a semicolon in C
- C Program to print numbers from 1 to N without using semicolon
- C++ "Hello, World!" Program
- How to write "Hello World" Program in C++?
- Hello World using Perl.
- Print âHello Worldâ with empty or blank main in C++

Advertisements