// Hypotenuse
#include <iostream>
#include <cmath>
#include <cstdlib>
usingnamespace std;
int main()
{
int x; //position of x-axis
int y; //position of y-axis
int A; //square A + square B
int V; //resultant vector
A = (x * x) + (y * y);
V = sqrt ( A );
cin>> x;
cin>> y;
cout<< V << "\n"; //output of resultant vector
cin.get();
return 0;
}
Hello everyone.This is my first year in computer engineering and we will have C++ in the next semester.However, i am trying to learn it myself..Here is my problem:
I am trying to calculate hypotenuse by giving to x and y different values.DEV C++ compiled it but when the dos screen is opened, i write two different values such as 3 and 4 (here the result must be 5), the windows closes itself.Can someone check where is the error?