Generation

generate functionThu, 06 Apr 2023

programa que calcule la hipotenusa con diferentes casos

#include <iostream> #include <math.h> using namespace std; float hipo(float a, float b){ float c = sqrt(pow(a, 2) + pow(b, 2)); return c; } int main(){ float a = 0; float b = 0; float c = 0; cout << "Ingrese a: "; cin >> a; cout << "Ingrese b: "; cin >> b; c = hipo(a, b); cout << "Hipotenusa: " << c << endl; return 0; }

Questions about programming?Chat with your personal AI assistant