Answer to Question #283589 in Java | JSP | JSF for Sri

Question #283589

Write Al algaritham for the network administrator to help him find the number of data character that do not change position even after the data change

1
Expert's answer
2021-12-30T01:37:20-0500
public class Main {
    public static void main(String[] args) {
        String one = "fgsdkgjs'lfj423581-";
        String two = "fgdklsj[05923-5fsd";
        int notChanged = 0;
        for (int i = 0; i < Math.min(one.length(), two.length()); i++) {
            if (one.charAt(i) == two.charAt(i)) {
                notChanged++;
            }
        }
        System.out.println(notChanged);
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog