can anyone give me the code snippet for this question.. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can anyone give me the code snippet for this question..

to get a numbers as a string, and save those in integers. ex: char str[2]={"13,6,5"}; int a,b,c; output // a=13 b=6 c=5 we muat give input in the form of {"13,6,5"}

17th Aug 2016, 5:40 PM
bassu S D
bassu S D - avatar
1 Answer
+ 2
Use Integer.parseInt to convert string number to interger. String[] str={"13","6","5"}; int a,b,c; a = Integer.parseInt(str[0]); System.out.print("a = "+a);
17th Aug 2016, 10:15 PM
WPimpong
WPimpong - avatar