Strange Numbers

Discuss Computer Science and Programming related problems

Moderators: bristy1588, Labib

User avatar
samiul_samin
Posts: 1004
Joined: Sat Dec 09, 2017 1:32 pm

Strange Numbers

Unread post by samiul_samin » Thu Feb 15, 2018 9:20 pm

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?

SYED ASHFAQ TASIN
Posts: 28
Joined: Thu Jun 02, 2016 6:14 pm

Re: Strange Numbers

Unread post by SYED ASHFAQ TASIN » Sun Sep 16, 2018 10:16 pm

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.
EARLY TO BED AND EARLY TO RISE,MAKES A MAN HEALTHY,WELTHY AND WISE.[\color]

User avatar
samiul_samin
Posts: 1004
Joined: Sat Dec 09, 2017 1:32 pm

Re: Strange Numbers

Unread post by samiul_samin » Thu Jan 10, 2019 4:03 pm

I have figured out the reason thanks.

SYED ASHFAQ TASIN
Posts: 28
Joined: Thu Jun 02, 2016 6:14 pm

Re: Strange Numbers

Unread post by SYED ASHFAQ TASIN » Mon Jan 28, 2019 1:40 pm

What was the mistake(s)?
EARLY TO BED AND EARLY TO RISE,MAKES A MAN HEALTHY,WELTHY AND WISE.[\color]

User avatar
samiul_samin
Posts: 1004
Joined: Sat Dec 09, 2017 1:32 pm

Re: Strange Numbers

Unread post by samiul_samin » Tue Jan 29, 2019 6:10 pm

SYED ASHFAQ TASIN wrote:
Mon Jan 28, 2019 1:40 pm
What was the mistake(s)?
Those was junk memory like undefined array value.Because I gave wrong datatype.

Post Reply