Strange Numbers
Moderators: bristy1588, Labib
- samiul_samin
- Posts: 1007
- Joined: Sat Dec 09, 2017 1:32 pm
Strange Numbers
When I run a usual C programme by codeblock to find the area of a circle,Iget exact value if I put any number.But when I input abcde or any other letter as the radius ,the compiler shows strange numbers.It is different according to inputs.It is not base 16 numbers.What are those strange numbers?
-
- Posts: 28
- Joined: Thu Jun 02, 2016 6:14 pm
Re: Strange Numbers
Are you saying that you are getting the actual area by defining radius as 'r' ?
Got that right?But I just tested and its running fine,have you used float?Define 'pi'?Have you used '%f' as format specifier?
If you yet suffering the problem,please share the programme .Then its going to be easy what's going on.
Thank you.
Got that right?But I just tested and its running fine,have you used float?Define 'pi'?Have you used '%f' as format specifier?
If you yet suffering the problem,please share the programme .Then its going to be easy what's going on.
Thank you.
EARLY TO BED AND EARLY TO RISE,MAKES A MAN HEALTHY,WELTHY AND WISE.[\color]
- samiul_samin
- Posts: 1007
- Joined: Sat Dec 09, 2017 1:32 pm
Re: Strange Numbers
I have figured out the reason thanks.
-
- Posts: 28
- Joined: Thu Jun 02, 2016 6:14 pm
Re: Strange Numbers
What was the mistake(s)?
EARLY TO BED AND EARLY TO RISE,MAKES A MAN HEALTHY,WELTHY AND WISE.[\color]
- samiul_samin
- Posts: 1007
- Joined: Sat Dec 09, 2017 1:32 pm
Re: Strange Numbers
Those was junk memory like undefined array value.Because I gave wrong datatype.