Bitwise Interview Question: How to print "hello world" by... | Glassdoor.co.in

Interview Question

Programmer Interview(Student Candidate) Pune

How to print "hello world" by using following if else

  block: if(write any condition you want) printf("World"); else printf("Hello"); I answered them that we can use goto statement, but he expected other answer that i didn't know at that time.
Answer

Interview Answer

5 Answers

5

it can be answered as
if("hello")
printf("world");
else
printf("hello");

deepak koundel on 16-Sep-2014
2

If(printf(" Hello"))

Ajit Patil on 10-Dec-2014
0

It is not possible in Java

Mayur Gite on 14-May-2016
0

boolean b=false;
    do
    {
    if(b)
            {
        System.out.print(" World");
        b=false;
            }
    else
    {
        System.out.print("Hello");
        b=true;
    }
    }
    while(b);

this should be d answer. on 31-Oct-2016
0

if(fork())
{
    printf("Hello");
}
else
{
   printf("World");
}

Anil on 05-Sep-2017

Add Answers or Comments

To comment on this, Sign In or Sign Up.