how to get output of a variable as float value

Posted by jaskirat on Stack Overflow See other posts from Stack Overflow or by jaskirat
Published on 2010-05-19T19:08:16Z Indexed on 2010/05/19 19:10 UTC
Read the original article Hit count: 271

Filed under:
|
|

hi..i m having the follwing problem.. want to get the result in float

suppose

int a= convert.toint32(textbox1.text);
int b= convert.toint32(textbox2.text);

float ans= math.sqrt(a*b);
label1.text= ans.tostring();

output..

a=7
b=3

ans should be= 4.582 but i get an error

cannot implicitly convert type 'double' to 'float'.

pls help..how can i get the float ans...

© Stack Overflow or respective owner

Related posts about c#

Related posts about float