Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- void main()
- {
- int inputan;
- int i;
- int power;
- int hasil=1;
- printf("masukan bilangan :");scanf("%d",&inputan);
- printf("masukan pangkat :");scanf("%d",&power);
- if (inputan == 0)
- {
- printf("%d",inputan);
- }
- else if(inputan == 1)
- {
- printf("%d",inputan);
- }
- else
- {
- for (i=1; i<=power; i++)
- {
- hasil*=hasil;
- {
- printf("%d\n",hasil);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment