Wednesday, April 22, 2009

…and AgentA knew theres’ an engineer inside him

Somewhere around 9th grade. The clock was ticking and it was 5 mins to submission. Final lab exam of computer science and had to write a program to generate first 10 prime number.

The urge to get in 90s was so strong that Agent A had to attempt this last question, and submit the exe in share.

Sol:

int void main()
{
      int i=0;
      cout<< "Enter 1 for prime numbers and 2 to exit:";
      cin>>i;
      if(i==1)
      {
          cout<<"2, 3, 5, 7, 11, 13, 17, 19, 23, 29";
      }
      else
      {   
          cout<<Exiting;
      }
      return 0;
}

Rest is History.

10 comments:

Sneha said...

100/100 to Agent A.:)

zirelda said...

give me hardware any day....

But good job to Agent A!

Aevi said...

good job to AgentA ? :D... this is the most dumb code i've ever seen...

Harshita said...

Mujhey 'C' nahi aati :(

Par itna pata hain... maamla gadbad hain :D

Swats said...

Agent A...lol...tht really got me laafing..

And I don't want to rack my brains over this :P

A rebel all the way... said...

hahahahhahaa....
while taapofying assignments and computer codes, i could atleast gather enough to understand the code you have written...:))))...had i been the examiner, i would have given you full marks (plus a few grace marks for hating coding) :P
but this is C++ and not C, right?

Aevi said...

C++ indeed :) codes been a bread n butter lately so wouldnt say i hate it
Thanks for the evaluation though :D

Deepika Gupta said...

*complicated*
*Alien*

Whatever it is..

Krishnan Kolazhi said...

haha...Thats funny...Ironically this solution is probably most effective for industry as well. Moral being...dont over complicate things till there is a need.

Good job!

Monika said...

hahahahaha.....cnt believe it tht th engineer really wrote this code......u made me laugh...wow!!!!glad to c this code...agent A...Mr. TP...