|
|
cin >> needs somewhere to store the input. It cannot put it in the empty string "" which is a read-only value./2*a means first divide by 2, then multiply the result by a. For the correct result it should be /(2*a) which means first multiply a by 2, then divide by that number.d is not negative before attempting to get the square root