Can someone please help me with this because it is driving me crazy.
I wrote a program which prompts the user to enter a number
I convert the string to an integer
when i print the value it sometimes comes out as a decimal e.g. 3.0
I thought an integer was a whole number so how is it printing as a decimal?
bryann 0 Newbie Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
bryann 0 Newbie Poster
bryann 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
bryann 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
bryann 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
bryann 0 Newbie Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
snippsat 661 Master Poster
Gribouillis commented: good link +14
dashing.adamhughes 0 Light Poster
sneekula 969 Nearly a Posting Maven
iJimJones 15 Newbie Poster
bryann 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.