Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • To Print Hello without using semi-colon

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 332
    Comment on it

    Printing Hello Without using semicolon:

    As we know to print something in C we use printf and ends it with semi-colon but we can print something without using semicolon.

    With Semicolon we print something like this:

    #include<stdio.h>
    void main()
    {
    printf("Welcome to findnerd");
    getch();
     }
    

    But without using semi-colon we can print something like this:

        #include<stdio.h>
        void main(){
             /*here if something is written inside printf condition is true and it will print it on console*/
            if(printf("Hello"))
            {
            }
        }
    

    We can also use switch case to print something without using semi-colon:

        #include<stdio.h>
        void main(){
            switch(printf("Hello")){
            }
        }
    

    while loop can be used to print something without using semi-colon, but it will print Hello infinite times:

    #include<stdio.h>
    void main()
    {
       while(printf("Hello"))
       {
       }
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: