I know the below code is riddled with errors. I am very new to C++ and I can run simple codes however this is my first time trying to do something this complicated. Well lets say complicated for me....
Type: Posts; User: genesis531501
I know the below code is riddled with errors. I am very new to C++ and I can run simple codes however this is my first time trying to do something this complicated. Well lets say complicated for me....
Well it did crash. As in nothing happend. I see the differences there in the formula. I declared remainder as an int at the start. However I was trying to intialize it and have the value declared as...
That's with the changes. It terminates before GCD can be displayed.
cout << "Input numbers are: " << x << " , " << y << endl;
if ( x < y)
{ // exchange values of x and y
temp=x;
x = y;
y=temp;
I appreciate that they did switch. thank you, The GCD should be left in y however the end of my code say to out put the GCD. no GCD is out putted.
I run the program and I input two numbers. program stops and it says what the input numbers are. It should however give me the GCD for the two numbers. In the compiler it shows no values being...
maybe a beter question would be if anyone is familair with switching variable values using a temp variable?
I am fairly new to C ++ and that is the error I am getting. I just want to know how to fix it.
When I try to simply put y=temp it doesn't work. No values switch at all. When it tires to compile it states that == has no effect however when it is there temp and x actually change values.
I'm trying to ru this code however it's not working for me. I need to switch the value of "x" with the value of "y" if (x<y) however it's not working the way I wrote it. Does anyone have any...