## Print Number with its Sign in Java

Sometimes we need to print the numbers with its sign irrespective of number is positive (+) or negative(-). Example: X … Read more

Sometimes we need to print the numbers with its sign irrespective of number is positive (+) or negative(-). Example: X … Read more

Objective: Given a number n and r, write a program to calculate Logrn Example: N = 32, r =2 Log232= … Read more

Objective: Given a number, write a program to find if number is power of two. Example: N = 5 Output: … Read more

Objective: Write a program to print first n numbers in Fibonacci series. Fibonacci number: First two Fibonacci numbers are defined … Read more

Objective: Given the base and height of a triangle, using math formula for calculating the area of triangle, write an … Read more

Objective – Given a number, Write a program to get the sum of digits in a number till it become … Read more

Objective: Given a number N, write a program to print first N prime numbers. What is Prime number:?? A prime … Read more

Objective: Write a java program to print your IP address. Approach: Get the local host address of your system using getLocalHost() method. … Read more

Area of a circumference = 2πR Where π = 3.14 and R = radius of circle Example: Radius = 4.0 … Read more

Objective– Given two strings, find out if they are equal or not without using any built-in function (without using equals() … Read more

Floyd’s Triangle: Floyd’s triangle is a right angled triangular array of natural numbers. It named after Robert Floyd. Rows of … Read more

Objective: Given a number N, write an program to print from number 1 to N without using loop. Example: N … Read more

Objective– Given two numbers, swap both the numbers using XOR operators. Example: X = 4, Y = 8 Output: X … Read more

Objective: Given a Year, write a java program to find whether year is leap year or not. Leap Year: a … Read more

Objective: Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead … Read more