I got this assignment and I'm stuck. I have to write a function that takes an integer value and returns the number with its digits reversed. For example, given the number 7631, the function should return 1367. Can someone help?
:confused:
DemonLady
0
Newbie Poster
Recommended Answers
Jump to PostI got this assignment and I'm stuck. I have to write a function that takes an integer value and returns the number with its digits reversed. For example, given the number 7631, the function should return 1367. Can someone help?
:confused:This question gets asked about once a week on …
Jump to PostHi! I also received this assignment, but was wondering if someone could help me fix my program (hopefully this constitutes "showing effort"). !
Depends -- is this your work or did you plagarize it from some other source ?
>> don't understand why it will work for relatively small …
Jump to PostWhat does this do?
num=GetInteger();
you would need a scanf here...
Jump to PostNo, never use scanf. Use fgets or even fread or read, and sscanf maybe. But then, the numbers conversion by sscanf is not specified in standard anyhow. And using %d, the sscanf does some strange things. %d must read int, but when we read into int and then print that …
Jump to PostAnd using %d, the sscanf does some strange things. %d must read int, but when we read into int and then print that number, it prints correctly even numbers which are greater than 65536. This should mean that it would write into memory larger than int allows, which is overflow. …
All 21 Replies
Dave Sinkula
2,398
long time no c
Team Colleague
swarren74
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
swarren74
0
Newbie Poster
SirJames
10
Newbie Poster
TkTkorrovi
69
Junior Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
TkTkorrovi
69
Junior Poster
vemanamar
0
Newbie Poster
TkTkorrovi
69
Junior Poster
TkTkorrovi
69
Junior Poster
c0ld sn1ff3r
-4
Newbie Poster
cutedipti
0
Light Poster
nadim2010
-1
Newbie Poster
jonsca
commented:
Don't bump old threads
-1
nbaztec
45
Posting Pro in Training
Xufyan
-4
Posting Whiz
andro23
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
andro23
0
Newbie Poster
ankithajain
0
Newbie Poster
Ajini
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.