Category: Problem Solving

Write a java program to Flush Characters.

Write a program to read a string from the user and remove all the alphabets and spaces from the String, and only store special characters and digit in the output String. Print the output string. The return type (String) should return the character removed string. Input and Output Format: Input consists of string. The output consists of a String

Write a java program to find Distance

Write a Program that accepts four int inputs(x1,y1,x2,y2) as the coordinates of two points. Calculate the distance between the two points using the below formula. Formula : square root of((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) Then, Round the result to return an int. Input and Output Format: Input consists of four integers. The output consists of a single integer. Refer

Write a java program to find Largest Difference.

Write a program to read an integer array, find the largest difference between adjacent elements and display the index of largest difference. EXAMPLE: input1: {2,4,5,1,9,3,8} output1: 4 (here largest difference 9-1=8 then return index of 9 ie,4) Input and Output Format: Input consists of an integer n which is the number of elements followed by