Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- double power(double n)
- {
- int q;
- double c=2;
- for (q=n; q>1; q--) {c*=n;}
- return c;
- }
- int main()
- {
- double n, output;
- scanf("%lf",&n);
- output=power(2,n);
- printf("%lf",output);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement