Q #1) Write a Java Program to reverse a string without using String inbuilt
function.
TWO POINTER ==> START AND END THERE ==> USES WHILE NOT FOR

Q #2) Write a Java Program to swap two numbers without using the third
variable.
ADD-SUB-SUB
CHANGE IN MIDDLE FINGER (B COMES)
Answer:
`public void swapNumbers(int a, int b) {
a = a + b; // A=A^B
b = a - b; // B=A^B
a = a - b; // A=A^B
System.out.println("After swap: a = " + a + ", b = " + b);
}`
Q 3) Write a Java Program to count the number of words in a string using
HashMap
Q #4)** Write a Java Program to iterate HashMap using While and advance for
loop.**
Q #5) Write a Java Program to find whether a number is prime or not in the most efficient way?

Q #6) Write a Java Program to find whether a string or number is
palindrome or not.

Q #7) Write a Java Program for the Fibonacci series in recursion.




Top comments (0)