Created
February 24, 2017 20:31
-
-
Save FelipeGrijo/e009bcc2eb984865f7767f8131baa808 to your computer and use it in GitHub Desktop.
1. Faça uma função que recebe por parâmetro o raio de uma esfera e calcula o seu volume (v =4/3.PI .R3).
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
//https://gist.github.com/FelipeGrijo | |
#include <stdio.h> | |
#include <conio.h> | |
#include <math.h> | |
#define PI 3.14 | |
float Volume(float raio){ | |
float v= 4/3 * (PI*pow(raio,3)); | |
return v; | |
} | |
int main(){ | |
float Raio,Resultado; | |
printf("Digite o raio de uma esfera para calcular o seu volume:"); | |
scanf("%f",&Raio); | |
Resultado=Volume(Raio); | |
printf("%.3f\n",Resultado); | |
getchar(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#include <stdio.h>
#include <conio.h>
#include <math.h>
#define PI 3.14
float Volume(float raio){
float v= 4/3 * (PI*pow(raio,3));
return v;
}
int main(){
float Raio,Resultado;