cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
show certain value?
show certain value?
Sep 7, 2011 at 3:39pm UTC
codrgi
(63)
How do i show the second last number/letter of a string/int?
for example take it we have the number 8888888
1
8, how do i just show the number 1?
Sep 7, 2011 at 3:58pm UTC
Undeclared
(26)
value%10 will give you last digit. Value%100 will give you last two digits and you would have to subtract the result of value%10 from it and then divide it by 10 to get the second last digit.
http://recurseit.blogspot.com
Topic archived. No new replies allowed.