"insert * if subsequent number even - if odd" Code Answer's
You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "insert * if subsequent number even - if odd" answered properly. Developers are finding an appropriate answer about insert * if subsequent number even - if odd related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like insert * if subsequent number even - if odd. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on insert * if subsequent number even - if odd.
insert * if subsequent number even - if odd
public class InsertStarBetweenEvenAndDashBetweenOdd {
public static void main(String[] args)
{
long l=104875l;
String s= ""+l;
StringBuilder s2= new StringBuilder("");
s2.append(s.charAt(0));
for(int i=1;i<s.length();i++)
{
int t1= Integer.parseInt(s.charAt(i-1)+"");
int t2= Integer.parseInt(s.charAt(i)+"");
s2.append((t1%2==0?(t2%2==0?"*"+s.charAt(i):s.charAt(i)):(t2%2!=0?"-"+s.charAt(i):s.charAt(i)))+"");
}
System.out.println(s2.toString());
}
}
Source: www.careercup.com
All those coders who are working on the Whatever based application and are stuck on insert * if subsequent number even - if odd can get a collection of related answers to their query. Programmers need to enter their query on insert * if subsequent number even - if odd related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about insert * if subsequent number even - if odd for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of insert * if subsequent number even - if odd while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "insert * if subsequent number even - if odd". Visit this developer's friendly online web community, CodeProZone, and get your queries like insert * if subsequent number even - if odd resolved professionally and stay updated to the latest Whatever updates.