Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- hello2.c.orig 2019-04-16 23:39:48.917017441 +0300
- +++ hello2.c 2019-04-16 23:48:58.039409090 +0300
- @@ -1,17 +1,19 @@
- -#include
- +#include <stdio.h>
- int main(){
- int a, n;
- printf("Enter number: ");
- scanf("%d", &a);
- printf("Enter power: ");
- -scanf("%d", n);
- -printf("%d", a);
- +scanf("%d", &n);
- +//printf("%d", a);
- if(n>1){
- +int aa=1;
- for(int i=0; i<n; i++)
- -a*=a;
- -printf("a=%d", a);
- +aa*=a;
- +a=aa;
- +printf("a=%d\n", a);
- }
- else
- -printf("a=%d", a);
- +printf("a=%d\n", a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement