Write a java program to print Fibonacci series up to N number, where N is the input integer. In this tutorial, We are going to write a java code to print fibonacci series.
-
Related Posts (YARPP)
-
Topics
-
-
Given two strings, write a code to check whether two strings are anagram of each other or not. In this tutorial, I am going to discuss multiple approaches and their java implementation to check if two strings are anagrams or not.
Let’s first understand what is an anagram? and how we are going to solve this problem.
Two strings are said to be anagrams of each other if it contains the same characters, only the order of characters in both the strings is different. In other words, both strings must contain the same exact letters in the same exact frequency.
How to check if a number is a power of two. Give an integer, write a function to check if it is a power of two.
Example –
Input – 16 – 16 is a power of 2 (2^4).
Input – 15 – 15 is not a power of 2.
Input – 32- 32 is a power of 2 (2^5).
We can use multiple approaches to check whether a number is a power of 2 or not.