Monday, January 09, 2012

Write a C program to print hello world without using semicolon

########## There are three way to Write a C program to print hello world without using semicolon ###########

Solution(1) :: Using a loop
#include<stdio.h>
void main(){
    while(!printf("Hello world")){
    }
}

Solution(2) :: Using a if statement
#include<stdio.h>
void main(){
    if(printf("Hello world")){
    }
}

Solution(3) :: Using a switch statement
#include<stdio.h>
void main(){
    switch(printf("Hello world")){
    }
}

No comments:

Post a Comment