

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- Print Hello World without semicolon in C++
- Python Program to Print Hello world
- How to print a semicolon(;) without using semicolon in C/C++?
- Print “Hello World” in C/C++ without using header files
- Print “Hello World” without using any header file in C
- C Program to print numbers from 1 to N without using semicolon
- How to print "Hello World!" using Python?
- Write a C program to print “ Tutorials Point ” without using a semicolon
- C++ "Hello, World!" Program
- Hello World using Perl.
- Write a program to print ‘Tutorials Point’ without using a semicolon in C
- Hello World Program in Java
- Creating Java Hello World Program
- Display hello world using React.js
- How to write "Hello World" Program in C++?
Advertisements