Skip to content

Z type detection fix 4#75

Open
tiagokapp wants to merge 2 commits intomasterfrom
z-type-detection-fix-4
Open

Z type detection fix 4#75
tiagokapp wants to merge 2 commits intomasterfrom
z-type-detection-fix-4

Conversation

@tiagokapp
Copy link

#include<stdio.h>

int elevado (int a);

int main (){

int k, resultado;

printf("digite o valor elevado a 2");
scanf("%d",&k);

elevado (k);
resultado =  elevado (k);
printf("%d", resultado);

}

int elevado (int k){

if (k==1){
	
	
	
	return 2;
}

else {

return (  2*elevado(k-1));

}

}

@tiagokapp
Copy link
Author

Algoritmo recursivo, que o usuário digita o valor ao qual será a potência que elevará o número natural 2, o algoritmo foi feito em linguagem C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant