Day dreamer
Tuesday, September 18, 2018
Qbasic programs to reverse the digits
# Write a program to reverse the digits
CLS
INPUT "enter any number";N
S = 0
WHILE N< > 0
R = N MOD 10
S = 10 + R
N = N \ 10
WEND
PRINT "Reverse digits ="; S
END
1 comment:
deepak
September 19, 2018 at 4:12 AM
mistake s=10+r
the correct one is s=s*10+r
will u correct this line
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
mistake s=10+r
ReplyDeletethe correct one is s=s*10+r
will u correct this line