Find out if an anagram of a string is subString of another String

Today we find the if an string given (anagram) is a sub-String of another string or not.

Output:
Anagram of ozma is substring of amazon

Remove the duplicates from the array without extra space.

Remove the duplicates from the array without extra space.

Here the logic is simple. If we are making the value in an array for the present index as negative. So that if we counter the same value again then we know encountered the negative value and we will know that this is a duplicate number. Study the program for more understanding.

Simple Calculator using switch statement

Today we are programming a simple calculator program which can perform addition, subtraction, multiplication and division. This question was asked by my friend in microsoft interview. Looks simple but very important.

Below is the program.

Result:
Enter the numeric value: 8
Enter the numeric value: 4
Choose from + , – , * , /: +
The numbers are : 8 and 4 option choose is +
The result is 12.0