This is a practise java problem solving repository. Also I have added a doc file which contains the output screenshots.
- Java Programming Language
- Intellij IDE
-
Suppose, a=10 and b=20. Now swap the value using a temp variable. Output: a=20, b=10
-
Suppose, a=10 and b=20. Now swap the value without a temp variable. Output: a=20, b=10
-
Suppose a=15.5276. print the value upto 2 decimal point. Output: a=15.52
-
Write a program that will find your key is found in the given array using binary search method numbers=[1,6,9,3,5,4,7] key=5
-
Write a program that will find your key is found in the given array using linear search method numbers=[1,6,9,3,5,4,7] key=5
-
Generate random 10 integer numbers in an array and print out all the numbers from array and also print the max and min number from the array
-
Write a program that will breakdown the amount and count notes for any given amount. Here is the notes in the given array: notes=[1000,500,200,100,50,20,10,5,2,1]
Example 1: User input: 575 Output: 500 1 50 1 20 1 5 1 Example 2: User input: 2148 Output: 1000 2 100 1 20 2 5 1 2 1 1 1
-
Print the prime numbers of 2 to 100
-
Write a program that will give following output: 1 12 123 1234 12345
-
Write a program that will give following output: 12345 2345 345 45 5
-
Find out the second largest element of the given array numbers=[5,3,9,7,4,1,8]
-
Write a program that will shuffle (values will randomly change their position) from the given array numbers=[1,2,3,4,5,6,7,8,9,0]
random output: 3 5 0 1 7 9 6 4 2 8
-
Take any number as input and print the reverse of the number input: 12345 output: 54321
-
Find out the duplicate numbers in the given array and in which position they are found. numbers=[1,2,3,1,2,4,5,6,4]
Output: Duplicate value: 1 at index 3 Duplicate value: 2 at index 4 Duplicate value: 4 at index 8
-
Count number of words, number of characters without spaces, number of vowels and consonant from the given string: "I live in Bangladesh" Output: Number of words: 4 Number of chars without spaces: 17 Number of vowels: 7 Number of consonant: 10
-
Encrypt word: ROADTOSDET [when A=F] Output: WTFIYTXIJY
-
Check if the given string is palindrome or not. Palindrome means after reversing a string, it will be same. Input: Civic Output: true Input: One Output: false
-
Write a program that will take integer numbers as user input continuously and print the sum of numbers until user input q from the keyboard. When user input q, program will be quit. If user inputs another character, then the program will ask to input the number again.
-
Extract the OTP from the SMS. "Your one time password is 246148. Don't share this code with anyone \r\nBvwt3f8js2S"
-
A core i 7 laptop price is 85000 tk and a gaming mouse price is 2500 tk. If I buy the laptop and 1 piece mouse, what will be my total cost after giving 15% discount? [Extract the digits from the paragraph and calculate the price]