Quantcast
Viewing all articles
Browse latest Browse all 34

c program to print hello world without using semicolon

Write a c program to print hello world without using semicolon. This is simple programming interview question. There very simple trick , we can avoid semicolon using if key word in c or c++.

#include<stdio.h>

int main()
{
  if( printf("Hello World\n"))
  return 0;
}

c program to print hello world without using semicolon using switch

#include<stdio.h>

int main()
{
  switch( printf("Hello World\n"))
  return 0;
}

c program to print hello world without using semicolon using for

#include<stdio.h>

int main()
{
  for( printf("Hello World\n");;)
  return 0;
}

c program using while

include<stdio.h>

int main()
{
  while( printf("Hello World\n"))
  return 0;
}

Learn more interview questions on http://wikistack.com/category/interview-question/

The post c program to print hello world without using semicolon appeared first on wikistack.


Viewing all articles
Browse latest Browse all 34

Trending Articles