Created
January 3, 2019 20:21
-
-
Save det-peralta/3748f88865736e62ea5ae39132d9ed0c to your computer and use it in GitHub Desktop.
expoente.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#define N_MAX 100 | |
int v[N_MAX]; | |
int b,i,resultado,a; | |
int main(void) | |
{ | |
printf("Introduza o expoente.\n"); | |
scanf("%d", &b); | |
printf("Introduza a base.\n"); | |
scanf("%d", &a); | |
for(i=0;i<b;i++){ | |
v[i]=a; | |
} | |
resultado=1; | |
for(i=0;i<b;i++){ | |
resultado=resultado*v[i]; | |
} | |
printf("O resultado da operacao e %d\n", resultado); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/LambdaSchool/CS-Wiki/wiki/Getting-Your-C-Compiler-Installed