KnowledgeZen Technology Consulting http://knowledgezen.appspot.com

knowledgezenforyou@gmail.com Assorted posts about Software design, development and debugging, algorithms and data structures, programming languages(C,C++,Python,Matlab,Javascript,...), programming puzzles,brain teasers and other technical stuff we find interesting.

Wednesday, 17 July 2013

My solution to the puzzle posted here few days back is below.

Implement a function h(n) as below:

h(h(n)) = -n

 static int run = 0  
 int f(n)  
 {  
 run++;  
 return (pow(-1,(run-1))*n);  
 }   
Posted by Unknown at 21:51
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2015 (2)
    • ►  June (2)
  • ►  2014 (7)
    • ►  December (1)
    • ►  November (3)
    • ►  September (1)
    • ►  March (1)
    • ►  January (1)
  • ▼  2013 (22)
    • ►  November (1)
    • ►  October (1)
    • ►  September (6)
    • ►  August (8)
    • ▼  July (6)
      • Solution to the puzzle Towering personalities
      • Towering personalities... A Puzzle.
      • My solution to the puzzle posted here few days bac...
      • Python functions - Default values as function argu...
      •                         function(function(n))=......
      •                                       C++ Copy co...

knowledgezenforyou@gmail.com

Unknown
View my complete profile

Popular Posts

Search This Blog

Copyright (c) 2013 http://knowledgezen.appspot.com. Awesome Inc. theme. Powered by Blogger.