Created
March 16, 2017 17:21
-
-
Save ninpl/cbc451cb3655bac55820819c0a5d1203 to your computer and use it in GitHub Desktop.
Hallar el volumen de una esfera
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
// Practica para refrescar la sintaxis de C++ | |
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
int main() | |
{ | |
// Hallar el volumen de una esfera | |
const float PI = 3.14159; | |
float radio,volumen; | |
cout<<"Ingrese el radio de la esfera : "; | |
cin>>radio; | |
volumen = 4/3*PI*pow(radio,3); | |
cout<<"El volumen es "<<volumen<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment