Advertisement
Icekilla

Untitled

Oct 31st, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. unsigned long power(int n)
  4. {
  5.       int q;
  6.       unsigned long c=2;
  7.       for (q=n; q>1; q--) {c=2*c;}
  8.       return c;
  9. }
  10.  
  11. int main()
  12. {
  13.     int n;
  14.     unsigned long output;
  15.     scanf("%i",&n);
  16.     output=power(n);
  17.     printf("%lu",output);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement