Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int potega(int x,int n)
- {
- int i;
- for(i=1;i<=n;i++)
- {
- x*=x;
- }
- return x;
- }
- int main()
- {
- int n,x;
- printf("Napisz konkretna liczbe oraz potege a program obliczy to: ");
- printf("\nLiczba: "); scanf("%d",&x);
- printf("Potega: "); scanf("%d",&n);
- printf("Liczba %d do potegi %d jest rowna %d",x,n,potega(x,n));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement