Online visitors

People learning around the world

Online

—

Visitors exploring W3Schools

Online visitors by country Circles show approximate country locations. The country list provides the visitor counts.

Circles represent countries, not exact visitor locations.

Country

Online

Loading country activity…

    C Program to Print Without Semicolon

    C Programming Examples


    This C program is used to print on the screen without using a semicolon.

    Semicolon must be used after printf function, but we can avoid this, by using printf function with if, while or switch statements.

    Program:

    #include<stdio.h>
    
    void main() {
    
        //Method One
        if(printf("Hello world"))
        {
        } 
        
        //Method Two
        while(!printf("Hello world"))
        {
        }
        
        //Method Three
        switch(printf("Hello world"))
        {
        }
    
    }

    Output:

    Hello world
    Hello world
    Hello world


    Found This Page Useful? Share It!
    Get the Latest Tutorials and Updates
    Join us on Telegram

    Notifications

    Updates are enabled for this browser.

    Receive new tutorials, articles and learning resources. You can turn updates off anytime.