Java Program to Find the First Non-repeated Character in a String

Write a java program to find the first non-repeated character in a string.Given an input string, we have to write a java code to find the first non-repeated character in a string.

For example –

i) Input string – java
Output – j (j is the first non-repeating character in a string)

ii) Input string – web rewrite
Output – b (b is the first non-repeating character in a string)

Swap Two Numbers in PHP – Explain with Code Examples

Write a PHP script to swap two numbers. In this tutorial, we are going to write a code to swap two numbers in PHP.

There are multiple approaches by which you can swap two numbers.

i) We can swap two numbers using third or temp variable.

ii) We can swap two numbers without using third variable.