JIGYASA
Would you like to react to this message? Create an account in a few clicks or log in to continue.
JIGYASA

An online placement forum.


You are not connected. Please login or register

Coding Query

4 posters

Go down  Message [Page 1 of 1]

1Coding Query Empty Coding Query Wed Mar 10, 2010 1:29 am

maven


Admin

How to print "Hello" without using a semicolon?

2Coding Query Empty Re: Coding Query Thu Mar 11, 2010 3:46 pm

arubuee



main()
{
if(printf ( hello world ))
{}
}

3Coding Query Empty @arubuee Thu Mar 11, 2010 4:36 pm

maven


Admin

Tats correct answer.Can we use for/while loop also?

4Coding Query Empty Re: Coding Query Thu Mar 11, 2010 10:18 pm

Incognito



I have one different solution
Use VB.NET to print (As in the question there is no constraint over language lol! )

Console.WriteLine("hello world")
Console.Read()

5Coding Query Empty Yes Sat Mar 13, 2010 2:12 am

indranil



maven wrote:Tats correct answer.Can we use for/while loop also?

You can take any construct which has a conditional check!

while(!printf("Hello World"))
{
}

for(;!printf("Hello World")Wink // note that there are semicolons here Smile
{
}

do
{
}while(!printf("Hello World"))

6Coding Query Empty @indranil Sat Mar 13, 2010 10:07 pm

maven


Admin

tats correct.. Smile here negation sign is imp otherwise it may run into infinite loop

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum