Posted by: Rufuz September 28, 2014
C++ guru, plz help
Login in to Rate this Post:     0       ?        
Ok this is where you are doing wrong.
You are declaring diameter perimeter area as a string and calculating as a numerical value. You can not compute math on string declaration. Its is good practice to initialize the values of diameter perimeter area to 0.0.
Also read the precedence of mathematical signs in c++. Whatever is in () is carried out first so make sure you have first calculated area= (pi *pow(r,2))/2;
For logical condition:

If (r>0.0){


Do this

}

Else {
output this
}

Hope that helps.
Read Full Discussion Thread for this article