## Print First n numbers in Fibonacci Series

Objective: Write a program to print first n numbers in Fibonacci series. Fibonacci number: First two Fibonacci numbers are defined as 0 and 1 and every number after the first two is the sum...

@tutorialhorizon

Objective: Write a program to print first n numbers in Fibonacci series. Fibonacci number: First two Fibonacci numbers are defined as 0 and 1 and every number after the first two is the sum...

A rectangle is a quadrilateral with four right angles. Say rectangle is given with side’s length A and B Area of Rectangle = A * B Perimeter of rectangle = 2(A+B) Code: Run This Code Output: Area of Rectangle:...

Objective: Given a String, write a java program to reverse the string using Stack Example: Input: “tutorial horizon” Output: “noziroh lairotut” Recommended: Please read Stack Data Structure before continue to read. Approach: Initialize a...

What is Stack?? Stack is an abstract data type (ADT) and very useful in programming. In computer science, a stack is an abstract data type that serves as a collection of elements. Majorly all the operations are done at only one...

In this article we will discuss about what is bubble sort, why it is considered as one of the simplest sorting algorithm, what its complexity, how we can improve the bubble sort algorithm. What...

Objective: Given the base and height of a triangle, using math formula for calculating the area of triangle, write an java program to calculate the triangle area. Area of a Triangle: (Base * Height)/2...

Objective: Given a number n, write a program to calculate Log2n without using built-in function. Example: N = 32 Log232 = 5 N = 64 Log264 = 6 Approach: Initialize result = 0. Keep...

Objective: Given a number N, write a program to print first N prime numbers. What is Prime number:?? A prime number (or a prime) is a natural number greater than 1 that cannot be...

Objective: Write a java program to print your IP address. Approach: Get the local host address of your system using getLocalHost() method. Use getHostAddress() method to get the IP address from local host address. Code:Run This Code...

Area of a circumference = 2πR Where π = 3.14 and R = radius of circle Example: Radius = 4.0 Area = 2*π*radius = 2*3.14*4 = 25.12 Java Code:Run This Code Output: Area of...

Objective– Given two strings, find out if they are equal or not without using any built-in function (without using equals() function in java). Example: String x=’tutorial’ and String y=’tutorial’ are equal – true String...

Objective: Given a String, remove all the vowels from the string. What Are Vowels? The letters A, E, I, O, and U are called vowels. The other letters in the alphabet are called consonants....

Objective: Given an array [] of n elements and a element ‘x’, write a program to search an element ‘x’ in the array. Example: Input [] = {20, 30, 40, 10, 5, 2, 60,...

Floyd’s Triangle: Floyd’s triangle is a right angled triangular array of natural numbers. It named after Robert Floyd. Rows of the triangle filled by consecutive numbers. First row will have single number which is...

Objective: Given a number N, write an program to print from number 1 to N without using loop. Example: N = 20 Output: 1 2 3 4 5 6 7 8 9 10 11 12...

%d bloggers like this: