JavaScript: Check a number from three given numbers where two numbers are equal, find the third one
JavaScript Basic: Exercise-111 with Solution
Find Unique Number Among Three
Write a JavaScript program to check a number from three given numbers where two numbers are equal. Find the third one.
Visual Presentation:

Sample Solution:
JavaScript Code:
Output:
1 2 Three numbers are unequal.
Live Demo:
Flowchart:

ES6 Version:
For more Practice: Solve these Related Problems:
- Write a JavaScript program that identifies the unique number among three inputs when two of them are equal.
- Write a JavaScript function that compares three numbers and returns the one that differs from the other two.
- Write a JavaScript program that accepts three numbers and determines the unique value when the other two are identical.
Improve this sample solution and post your code through Disqus.
Previous: JavaScript program to find the number of even values in sequence before the first occurrence of a given number.
Next: JavaScript program to find the number of trailing zeros in the decimal representation of the factorial of a given number.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics