JIGYASA

An online placement forum.


You are not connected. Please login or register

Coding Query

Go down  Message [Page 1 of 1]

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

maven


Admin
How to print "Hello" without using a semicolon?

View user profile

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

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

View user profile

3 @arubuee on Thu Mar 11, 2010 4:36 pm

maven


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

View user profile

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

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()

View user profile

5 Yes on Sat Mar 13, 2010 2:12 am

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"))

View user profile

6 @indranil on Sat Mar 13, 2010 10:07 pm

maven


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

View user profile

Sponsored content


Back to top  Message [Page 1 of 1]

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