- Write a program to print numbers from 1 to 10, excluding 4,7,8.
- Given an array of 1 to n numbers with one number missing, write a program to print the missing number.
- Write a program to print the sum of all even numbers from 1 to n.
- Write a program to print the sum of all odd numbers from 1 to n.
- Write a program to print the composite numbers (non-prime numbers) from 1 to n.
- Given three random integers, find whether they will form right angles triangle or not.
- Given an integer array, find which two elements gives the maximum product.
- Write a program to find the first and last digits of an integer number.
- Write a program to swap the first and last digit of a given number.
- Write a program to find the length of an integer number.
- Write a program to find to calculate the sum of all digits in a given number.
- Write a program to print the array of integers in reverse order.
- Write a program to find the greatest of three numbers without using Max function.
- Write a program to find the maximum from the given array without using Max function..
- Write a program to find the distinct and duplicates elements from an array.
- Write a program to print the frequency of each digit in a given number.
- Write a program to sort an array in ascending order without using any inbuilt functions.
- Write a program to sort an array in descending order without using any inbuilt functions.
- Write a program to sort the first 4 elements of an array.
- Write a program to swap two values in a variable.
- Write a program to swap two values in a variable without using third variable.
- Given a number, calculate the sum of all even digits and all odd digits separately in a given number.
- [Complex] Given a array of 10 numbers, find the largest sum of subset of 3 continous elements.
- Write a program to remove the leading and trailing white spaces from a String.
- Write a program to reverse a string without using the reverse function.
- Write a program to find whether a string is palindrome or not.
- Write a program to print the frequency of each character in a given word.
- Write a program to the least occurring character from a given string.
- Write a program to the most occurring character from a given string.
- Write a program to convert the numeric String to an int.
- Given a string “AAABBCDA”, write a program that give the output as “A4B2C1D1”.
- Given a string ‘ABC CORPORATION CENTER’, find the index of second last ‘C’.
- Given a string like “abds323a4b45a”, write a program to find the count the number of digits present in the string.
- Given a string like “abds323a4b45a”, write a program to find the sum of each digit present in the string.
- Given a String ‘HELLO, HOW ARE YOU’, print all the vowels that occurred in the string.
- Given a string like “abds323a47b5a”, write a program to find the sum of each number present in the string. A number is considered when it is followed by another numner. O/P -> 323+47+5=370.
- Write a program to add the two string in time format (HH:MM) without using date time library.
- Write a program to convert ‘GooD MorNinG’ to gOOd mORnINg without using toUpperCase and toLowerCase functionality.
- Given a string “How are you. Mr”, write a program to print letter/letters after “.”
- Write a program to print the next letter of each character from a given String. Ex -> I/P = HARI, O/P = “IBSJ”.
- Given a string abc_u@gmail.com, find whether it is valid email address or not. A valid email will have the format “a-z._”@gmail.domain Domain can be “com, in, eu, us”
- Write a program to rotate a string. Eg. “ABCD” to “DABC”.
- Write a program to find all the permutations of a String. String will not contain any duplicates. Eg. I/P “xyz”, O/P->”xyz”,”yzx”, ”zxy”,”xzy”,”yxz”,”zyx”.
- Write a program to remove all the white spaces in a string.
- Given a string "ABCBCBAABCB", count the occurrence of “BCB”
- Write program to find wether the single group of elements in an array is present in the another with respective of order Example : Arr1 = [a:b:c;d:e:f;g;h;i] Arr2 = [a:c] Output : True.
- Write a program to convert a list to an array.
- Write a program that defines a person class with attributes firstName, lastName, and age. Given a list of 10 persons (List<others.Person>), sort the list by implementing the Comparable interface by age.
- Write a program that defines a person class with attributes firstName, lastName, and age. Given a list of 10 persons (List<others.Person>), sort the list by implementing the Comparator interface by firstName.
- Write a program that defines a person class with attributes firstName, lastName, and age. Given a map grouped by age.
- How to reverse an ArrayList in java.
- Given a list, how would you convert it to an unmodifiable list.
-
Write a program to reverse an integer.
-
Write a Set of 5 numbers in single line.
-
Write a method that print whether a given is greater than 5 or not. You can use only if block. not, else block, or any other loop, or declare a new variable.
-
Write a program to find the prime numbers from 1 to 100.
-
Write a program to rotate the matrix by 90 degree in clockwise and anticlockwise.
-
Given a string, does "xyz" appear in the middle of the string? To define middle, we'll say that the number of chars to the left and right of the "xyz" must differ by at most one. xyzMiddle("AAxyzBB") → true xyzMiddle("AxyzBB") → true xyzMiddle("AxyzBBB") → false xyzMiddle("ABBxyzB") → false
-
Write a program to reverse a string reserving the spaces. Eg. input --> "Hello, My name is Sumeet" output --> "teemuS si eman yM ,olleH"
-
Given an array, move all the zeroes to the end of the array.
-
Split the string with spaces and string enclosed within double quotes should be considered as one.
-
Print the numbers from 1 to 100 excluding all the squares of the numbers upto 100.
-
Write a program to remove all the duplicate white spaces in a string. i/p ---> I live in Bangalore o/p ---> I live in Bangalore
-
Write a program to multiply all indices of an array except the current one. eg. i/p -->[1,2,3,4] o/p --> [24,12,8,6]
-
Write a program to print all two digits numbers whose digits sum would be 10. Eg 22 will not be printed as 2+2!=10 while 28 would be printer as 2+8=10
-
What will be the output of the following program public class Question65 {
private int a; private Integer b;
Question65(int a, Integer b) { a=a; b=b; }
public void outputPrint() { System.out.println(String.format("a = %s, b = %s",a,b)); }
public static void main(String[] args) { Question65 question = new Question65(10,50); question.outputPrint(); } }