EASY JAVA || C || C++ || JavaScript CODE || BEATS 100%
Intuition\n Describe your first thoughts on how to solve this problem. \nWe all know that if given integer n is an even number than it is already the smallest e
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nWe all know that if given integer n is an even number than it is already the smallest even multiple, if it is odd then we can multiply by 2 as any odd number multiplied by 2 will result in an even number. \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. We are given an input integer "n" and we need to find the smallest even multiple of "n".\n1. We start by checking if "n" is already even by using the condition n % 2 == 0. If it is even, we can return "n" itself as it is already the smallest even multiple.\n3. If "n" is not even, it means it is an odd number. In this case, we need to find the smallest even multiple of "n".\n4. We can obtain the smallest even multiple by multiplying "n" by 2, as any odd number multiplied by 2 will result in an even number.\n5. Finally, we return the result, which is the smallest even multiple of "n".\n\n# Complexity\n- Time complexity: O(1)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# JAVA Code\n```\nclass Solution {\n    public int smallestEvenMultiple(int n) {\n        if(n%2 == 0){\n            return n;\n        }\n        return n*2;\n    }\n}\n```\n# C Code\n```\nint smallestEvenMultiple(int n){\n    if(n%2 == 0){\n        return n;\n    }\n    return n*2;\n}\n```\n# C++ Code\n```\nclass Solution {\npublic:\n    int smallestEvenMultiple(int n) {\n        if(n%2 == 0){\n            return n;\n        }\n        return n*2;\n    }\n};\n```\n# JavaScript Code\n```\nclass Solution {\n    public int smallestEvenMultiple(int n) {\n        if(n%2 == 0){\n            return n;\n        }\n        return n*2;\n    }\n}\n```
['C', 'C++', 'Java', 'JavaScript']