Printing "Hello World" Without using Semi Colon
How to write a C/C++ program which prints the message "Hello World" on the screen, which does not contain a semi colon. So you should write a program without a single semi colon.
//Solution 1
#include<stdio.h>
int main()
{
if(printf("\nHello World!!!\n"))
{
}
}
int main()
{
if(printf("\nHello World!!!\n"))
{
}
}
//Solution 2
#include<stdio.h>int main(int argc, char *argv[printf("\nHello World!!!\n")])
{
}
Download
//Solution 3
#include <stdio.h>
int main(void *Hello[printf("\nHello world!!!\n")]) {}
int main(void *Hello[printf("\nHello world!!!\n")]) {}
Download
There might be other solutions. If you come across any such solution please post a comment.
No comments:
Post a Comment