Compare two strings lexicographically in Java
Write a java program to compare two strings lexicographically. Lexicographical order is nothing but the dictionary order or preferably the order…
Write a java program to compare two strings lexicographically. Lexicographical order is nothing but the dictionary order or preferably the order…
Write a java program to find Pair of Integers in Array whose Sum is Given Number. The Number of Inputs are…
Mana is out on a hike with friends. She finds a trail of stones with numbers on them. She starts following…
Get array as input and display the sum of array elements as outputs. S = sum(A) returns the sum of the…
If the user pressed number keys( from 0 to 9), the program will tell the number that is pressed, otherwise, program…
Write a program to accept a n X n matrix and print addition of diagonal elements of that matrix. Input: size…
Write a java program to display the following patterns. Input: 5 Output: * *** ***** ******* ********* import java.io.*; import java.util.*;…
Write a java program to display the following patterns. Input: 7 Output: 7 6 5 4 3 2 1 7 6…
Declare a protected static variable outside the main and increment the variable inside a function which is called inside the main…
The International Mobile Equipment Identity (IMEI) number is a unique identification or serial number that all mobile phones and smartphones have.…
Java program to convert from decimal to octal. Input: Decimal Number: 50 Output: Octal Number: 62 import java.io.*; import java.util.*; public…
Given a number (n) , the task is to find if its divisible by 11 or not. Input:The first line of…
Write a program to print reverse of a number of the given number. Input: 987654321 Output: 123456789 import java.io.*; import java.util.*;…
Write a Java program to declare integer variables, float variable, get input from user and Then display their values on the…
Java program to check number for prime or not. If the number is Prime print "yes" else print "no" Input: 1…
Java Program to convert from binary to decimal number Input: 1111 //Binary Number Output: 15 //Decimal Number import java.io.*; import java.util.*;…
Java Program to Swap two numbers by using division and multiplication. Input: 650 350 Output: 350 650 import java.io.*; import java.util.*;…
Many people think about their height in feet and inches, even in some countries that primarily use the metric system. Write…
Write a java program to print concatenated strings . You can + operator to concatenate strings and print it. Input: //…
Write a program that asks the user's name, and then greets the user by name. Before outputting the user's name, convert…