'C' Magic...!

by Guest 6/23/2008 4:45:24 PM

Wanna see a magic with 'C' program? Here is the one.
It's a very interesting program that creates the shape of India Map using "!" symbol.
Try it out yourself to know the logic... hmm... frankly speaking, even i am also looking for the logic.... Let me know if u found it....!Smile

 

 

(include the necessary header files depending on the version of your C compiler. Default is stdio.h)

main()
{
int a,b,c;

for (c=b=10;a="SARAYU,TFy!QJu ROo TNn(ROo)SLq SLq ULo+\UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\HCStHAUFAgcEAelclcn^r^r\\tZvYxXyS~Pn SPm SOn TNn ULo0ULo#ULo-W\Hq!WFs XDt!" [b++];)
for(; a-- > 64 ; )
putchar ( ++c==90 ? c=10:33^b&1);
getch();
}

 

Regards,

SarayuSmile

Currently rated 4.7 by 3 people

  • Currently 4.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Comments

6/23/2008 10:10:53 PM

Does this really work? I don't have a C compiler to try this out.. :-(

I spent half-an-hour trying to understand the logic.. but no luck. If this works, whoever wrote this, must be a real good programmer.

I can't resist asking, variable 'a' in the first for loop is assigned a string that starts with your name..? What does the final output look like? India map with 'Sarayu' in it??

Ram in

6/24/2008 10:22:02 AM

its working... the output is just an india map formed by "!".
me too don't know the logic...!

sarayu in

7/2/2008 12:16:16 PM

This seems to be a hoax..Why is your name put in the code, it does not appear anywhere in the MAP.I tried compiling this using online compiler http://www.delorie.com/djgpp/compile/ ...and it gave so many errors..
DJGPP Public Access Compiler

cc1: warnings being treated as errors
/tmp/http.24592.c:4: warning: return-type defaults to `int'
/tmp/http.24592.c: In function `main':
/tmp/http.24592.c:7: warning: unknown escape sequence `\U'
/tmp/http.24592.c:7: warning: unknown escape sequence `\N'
/tmp/http.24592.c:7: warning: unknown escape sequence `\H'
/tmp/http.24592.c:7: warning: unknown escape sequence `\H'
/tmp/http.24592.c:7: warning: suggest parentheses around assignment used as truth value
/tmp/http.24592.c:9: warning: suggest parentheses around arithmetic in operand of ^
/tmp/http.24592.c:10: warning: implicit declaration of function `getch'
/tmp/http.24592.c:11: warning: control reaches end of non-void function

Deepu in

Comments are closed

Add/Search Topic

Post a new topic!



Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

About IT Pepper

IT Pepper is the Official Indian IT & ITES Employee blog! Share your experience, thoughts, feelings or emotions anonymously.

Click here to post your story.

E-mail us Send mail