firstly, get used to putting your code between [ code ] and [ /code ] tags (without the spaces)...
secondly.. here's a hint
Code:
#include <iostream.h>
#include <math.h>
#include <stdlib.h>
int main()
{
char buffer[12];
int x, y;
cout << "Please give me the two legs of the triangle." << endl;
do
{
cout << "First leg: " << endl;
cin.getline(buffer, sizeof(buffer));
x = atoi(buffer);
} while(x == 0);
do
{
cout<<endl<<"Second leg: "<<endl;
cin.getline(buffer, sizeof(buffer));
y = atoi(buffer);
} while(y == 0);
cout << endl << "one moment please..." << endl;
cout << "the hypotenuse length is " << sqrt(x * x + y * y) << endl << endl;
return(0);
}
the program is not complete.. but it's nearly there.. i didn't want to finish it for you because you wouldn't learn anything from it!
good luck
U.