|
|
|
|
while
is a control structure. See http://www.cplusplus.com/doc/tutorial/control/0.5c
must be 0.5 * c
^
does something entirely different. See http://www.cplusplus.com/doc/tutorial/operators/r*r
|
|
the way i set up my int of the area above, is that the right way to do it or i need multiple of ints for each numbers?
x^2
to x*x
and change 0.5X
to 0.5*X
EDIT: @Arslan7041: That has bad things in it. Why should the diameter and chord be integers? The data example shows 10.17 as input for chord. What are the lines 11 and 22? The line 13 does input as instructed. The comment on line 24 ... line 13 reads into int variable. Any input that does not convert to int, "q" for example, will set the input stream into error state. While that definitely interrupts the loop, any further input would require clearing the error first. Educational, yes. Probably won't affect this program, but the surprise will hit in future assignments. Input is not as "simple" as it seems. |