CHALLENGE #####!!!!!! ADD NUMBER IN STRING | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

CHALLENGE #####!!!!!! ADD NUMBER IN STRING

ADD number in string without using any built in function like isdigit For example string name="on this table 3 books and 4 pen"; output 3+4=7 answer =7

28th May 2018, 9:42 PM
Muhammad Zubair Irshad
Muhammad Zubair  Irshad - avatar
13 Answers
+ 2
no but suddenly i think about it i already did ot by using bulit in function and now i am stuck because i am trying to do it without using built in function
28th May 2018, 10:08 PM
Muhammad Zubair Irshad
Muhammad Zubair  Irshad - avatar
+ 3
Muhammad Zubair Irshad hi, u can check this out, let me know if this kinda coding u were looking for. https://code.sololearn.com/cn5lI0xxxiZa/?ref=app
3rd Jun 2018, 10:30 PM
Flash
+ 1
Did someone told you to do this?
28th May 2018, 10:06 PM
Ibaadi Jaya
Ibaadi Jaya - avatar
+ 1
My code has a bug... do you want me to show it?
28th May 2018, 11:44 PM
Ibaadi Jaya
Ibaadi Jaya - avatar
+ 1
This could simply be done by having a conditonal if statement and using charAt. By iteraring through the string. If the postion is a number between 0-9; add it.
29th May 2018, 7:02 AM
Ben
+ 1
Ben will you please post a code in c++
30th May 2018, 5:34 PM
Muhammad Zubair Irshad
Muhammad Zubair  Irshad - avatar
+ 1
Muhammad Zubair Irshad hi, check out now, without builtin std::isdigit(). i hope that follows the challenge constrain. https://code.sololearn.com/cn5lI0xxxiZa/?ref=app
4th Jun 2018, 12:39 AM
Flash
0
Do you mean "SUM" ?
28th May 2018, 10:04 PM
Ibaadi Jaya
Ibaadi Jaya - avatar
0
yes
28th May 2018, 10:05 PM
Muhammad Zubair Irshad
Muhammad Zubair  Irshad - avatar
0
Ben will u please put complete code in comment box
29th May 2018, 11:09 PM
Muhammad Zubair Irshad
Muhammad Zubair  Irshad - avatar
0
https://code.sololearn.com/crRQqjrVmEKR/?ref=app The code has been posted. If you have any questions let me know. It is better to understande the code.
30th May 2018, 5:52 AM
Ben
0
please post a code in C++
30th May 2018, 5:33 PM
Muhammad Zubair Irshad
Muhammad Zubair  Irshad - avatar
0
Flash its awsome but you were use isdigit function . without use any built in function is it possible??
3rd Jun 2018, 11:48 PM
Muhammad Zubair Irshad
Muhammad Zubair  Irshad - avatar