top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C: Print a string without semicolun

0 votes
582 views

I want to write some C code where I want to print a string say "Hello World" but don't want to use semicolun(;), how can I achieve that.

posted Jul 3, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

3 Answers

+2 votes

There are three way to do this

#include<stdio.h>
void main() {

//Method One
if(printf("Hello world"))
{
} 

//Method Two
while(!printf("Hello world"))
{
}

//Method Three
switch(printf("Hello world"))
{
}

}
answer Jul 4, 2014 by Gaurav Maurya
0 votes
if (printf("Hello World"))
{

}

This is one of the way to write. There may be other ways too.

answer Jul 3, 2014 by Rupam
0 votes

You can make printf as part of condition and rest is simple -

#include<conio.h>

int main()
{
  if(printf("hello world"))
     return 1;
  else 
     return 0;
}
answer Jul 3, 2014 by Salil Agrawal
Similar Questions
+6 votes

Say you are given "Hello World"
Output should be "olleH dlroW"

+4 votes

Requirements:

1.No input should be processed, and the output should be in the form of 2 3 5 7 11 13 ... etc.
2. No reserved words in the language are used at all
3.The language should at least allow structured programming, and have reserved words (otherwise point 2 would be moot).

...