Wednesday, October 30, 2013

C Program to Print Hello word without using semicolon

C program to print without using semicolen:
(Solved Programs)
thanks to-
www.c4learn.com

Part 1 : Printf Hello word in C without using semicolon [only ones ]

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

Output :
Hello

Part 2 : Printf Hello word in C without using semicolon [infinite times]

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

Part 3 : Printf Hello [Using Switch]

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

Part 4 : Using Else-if Ladder

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

Part 5 : Printf Hello [Using While and Not]

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

Part 6 : Using #define

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

No comments: