Teaser - 2

21 replies [Last post]
bOtskOOl
Offline
Last seen: 9 years 49 weeks ago
Joined: 2009-02-21
bOt Points: 3500

 

Here's a second teaser

 

Write a program in C to print "HI",  without using any semi colon.

 

the first three correct entries win 20 bOt points each.

 

 

NOTE:

A correct may not fetch you bOt points incase  a similar solution has already been posted.

 

 

 

 

aashiqcoolguy21
Offline
Last seen: 9 years 43 weeks ago
Joined: 2009-05-31
bOt Points: 3354
#include<stdio.h> main() { if

#include<stdio.h>

main()

{

if(printf("HI\n"))

}

 

I think this will do the required job

 

 

nitesh
Offline
Last seen: 9 years 29 weeks ago
Joined: 2009-03-26
bOt Points: 370
Code doesnt run

the code that you post should run correctly, which is not the case here 

heloitsadi
Offline
Last seen: 10 years 28 weeks ago
Joined: 2009-03-15
bOt Points: 1321
main() { if (printf("HI"))

main()

{

if (printf("HI"))

    {

    }

}

 

Though already posted

aashiqcoolguy21
Offline
Last seen: 9 years 43 weeks ago
Joined: 2009-05-31
bOt Points: 3354
i got the mistake....

#include<stdio.h>

main()

{

int i;

if (printf("HI\n"))

i=1;

}

 

 

heloitsadi
Offline
Last seen: 10 years 28 weeks ago
Joined: 2009-03-15
bOt Points: 1321
what is the diffrence dear..

what is the diffrence dear.. both are same...

aashiqcoolguy21
Offline
Last seen: 9 years 43 weeks ago
Joined: 2009-05-31
bOt Points: 3354
or it can be

#include<stdio.h>

int main()

{

if(printf("HI")

{

}

}

 

 

nitesh
Offline
Last seen: 9 years 29 weeks ago
Joined: 2009-03-26
bOt Points: 370
Incorrect

You are not allowed even a single semi-colon

You have used two. 

aashiqcoolguy21
Offline
Last seen: 9 years 43 weeks ago
Joined: 2009-05-31
bOt Points: 3354
yeah they are ..

yeah they are but as nitesh said its not running on compiler!!! so i tried this .. but the basic concept of mine is correct I think...!!

 

 

gopal
Offline
Last seen: 10 years 37 weeks ago
Joined: 2009-06-04
bOt Points: 54
#include<stdio.h> #include<co

#include<stdio.h>

#include<coni.h>

main()

{

       if(printf("HI"))

       {

            }

     if(getch())

      {

      }

}

 

heloitsadi
Offline
Last seen: 10 years 28 weeks ago
Joined: 2009-03-15
bOt Points: 1321
Here is second

Here is second one..

 

#include <stdio.h>

int main()

{

while(printf("Hi")&&0)

{

heloitsadi
Offline
Last seen: 10 years 28 weeks ago
Joined: 2009-03-15
bOt Points: 1321
Here is third

Here is third one...

 

 

#include<stdio.h>

main()

{

while(printf("hi")?0:1)

{

 

heloitsadi
Offline
Last seen: 10 years 28 weeks ago
Joined: 2009-03-15
bOt Points: 1321
botskool start similar

botskool start similar teasers for robotics as well.... 

nitesh
Offline
Last seen: 9 years 29 weeks ago
Joined: 2009-03-26
bOt Points: 370
@heloitsadi

@heloitsadi

 

You get +40 for two correct attempts

the third one is correct but does not qualiy for points

 

 

 

Still 20 points to be won 

heloitsadi
Offline
Last seen: 10 years 28 weeks ago
Joined: 2009-03-15
bOt Points: 1321
why not...

why not...

 

nitesh
Offline
Last seen: 9 years 29 weeks ago
Joined: 2009-03-26
bOt Points: 370
@heloitsadi

thats just a minor tweak over  your previous answer 

heloitsadi
Offline
Last seen: 10 years 28 weeks ago
Joined: 2009-03-15
bOt Points: 1321
i have used diffrent

i have used diffrent operators in that... ok i will see for some other also... 

aashiqcoolguy21
Offline
Last seen: 9 years 43 weeks ago
Joined: 2009-05-31
bOt Points: 3354
Is it correct??

#include<stdio.h>

int main(void)
{if(printf("HI")>=0){}
 }

 

 

aashiqcoolguy21
Offline
Last seen: 9 years 43 weeks ago
Joined: 2009-05-31
bOt Points: 3354
Chl out my thrd answer yar ..

Chl out my thrd answer yar .. else i shud go for other wese its running with one warning....!!

 

 

aashiqcoolguy21
Offline
Last seen: 9 years 43 weeks ago
Joined: 2009-05-31
bOt Points: 3354
even this is also

even this is also wrking

 

#include<stdio.h>

int main(void)
{if(printf("HI")==0){}
 }

 

 

aashiqcoolguy21
Offline
Last seen: 9 years 43 weeks ago
Joined: 2009-05-31
bOt Points: 3354
#include<stdio.h> int

#include<stdio.h>

int main(void)
{if(printf("HI")<=0){}
 }

 

this also works...!!

 

 

bOtskOOl
Offline
Last seen: 9 years 49 weeks ago
Joined: 2009-02-21
bOt Points: 3500
End of Teaser 2

@aashiqcoolguy 

as already pointed out your attempts are just minor tweaks over correct attempts. So they dont fetch points

 

 

 

Nyways teaser 2 is now closed.