In Accordance with my previous mail I am copying the code for two Java programs which were asked at Subex They asked three questions and out of those 3 we have to answer any one the questions with solution are:
1. Write a program to print the divisor.
Ex- 12-------------2 3 4
import
java.io.*;
class
divisor
{
public static void main(String arg[])
{
try{BufferedReader br new BufferedReader(new InputStreamReader(System.in));System.out.println( Please Enter the No. );int a Integer.parseInt(br.readLine());for(int i 2;i<a;i++)
{
int b a i;if(b 0)
{
System.out.print(i+ );
}
}
}
catch(Exception e){}
}
}
2. Write a program to print the Vowel from the String
Ex-mutable----------u a e
mport
java.io.*;
class
vowel
{
public static void main(String arg[])
{
try{BufferedReader br new BufferedReader(new InputStreamReader(System.in));System.out.println( Please Enter the String );String s br.readLine();for(int i 0;i<s.length();i++)
{
char c s.charAt(i);if(c 'a'||c 'e'||c 'i'||c 'o'||c 'u')
Hi I have attended interview on June 16 (With 2 years exp)
Total : 30 mins Only 2 Java Questions (You have to answer for 1 question)
1) Java dates
a) Create a function which will accept a date string - Do Validation for given date b) Add days with date c) Substract days with date d) Find difference in number of day between 2 dates
2) List function
a) Write a program for list add function b) Write a progarm for list find c) Write a progarm for list remove d) Write a progarm for list sort