
1)write a prgrame to idetify common elements r number between two given arrays , you should not use any inbuild java method are list to find common values.
2)you have got a range of number 1 to n where one of the number is repeated,
3) write a prgrame to print fibonaccis series with and without recursive approach
output - 0 ,1,1 , 2, 3 ,5, 8 13, 21, 34, 55, 89, 144, 233,377
4) write a prgrame to reverse a number?

Here is an example that compares two array and display the common elements between them.
public class FindCommonElement {
public static void main(String args[]) {
int[] arr1 = {1,2,3,4,5};
int[] arr2 = {3,4,12,9,40,32,2};
for(int i=0;i<arr1.length;i++){
for(int j=0;j<arr2.length;j++){
if(arr1[i]==arr2[j]){
System.out.println(arr1[i]);
}
}
}
}
}

Here is an example of Fibonacci Series without recursive approach.
public class Fibbonacci {
public static void main(String[] args) throws Exception {
int num = 15;
long[] series = new long[num];
series[0] = 0;
series[1] = 1;
for(int i=2; i < num; i++){
series[i] = series[i-1] + series[i-2];
}
System.out.println("Fibonacci Series upto " + num);
for(int i=0; i< num; i++){
System.out.print(series[i] + " ");
}
}
}

Here is an example of reversing number where user is allowed to enter the number which is to be reversed.
import java.io.*;
class ReverseNumber
{
public static void main(String[] args) throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Number");
int num= Integer.parseInt(br.readLine());
int n=num;
int rem=0;
int rev=0;
while(n!=0)
{
rem = n%10;
rev = rev*10+rem;
n=n/10;
}
System.out.println("Reverse Number : " + rev);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.