Hello,i have to attend subes written test on java. plz helpregrding question patterns in subex technologies.Bangalorethank you dev

Showing Answers 1 - 12 of 12 Answers

lucky

  • Dec 16th, 2006
 

They asked 3 question and answered only one.

1. Write a program to print the divisor.

 Ex- 12-------------2,3,4

2. Write a program to print the Vowel from the String

Ex-mutable----------u,a,e

  Was this answer useful?  Yes

Lucky

  • Dec 18th, 2006
 

Hi,

  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')

{

System.out.print(c+",");

}

}

}catch(Exception e){}

}

}

  Was this answer useful?  Yes

narayanna

  • Jun 16th, 2007
 


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

All the best

  Was this answer useful?  Yes

Harihar

  • Nov 28th, 2009
 

//program to find the divisor of a number
//By :Harihar pai
//Contact me at harihar.pai1@gmail.com




import java.io.*;
import java.lang.*;
class divisor
{
    public static void main(String args[])
    {
        DataInputStream in= new DataInputStream(System.in);
        int number=0,i;
        System.out.println("enter a number");
        try
        {
            number=Integer.parseInt(in.readLine());
            for(i=1;i<=number;i++)
            {
                if((number % i)==0)
                {
                    System.out.println(" "+i);
                }
            }
        }
        catch(Exception e)
        {
            System.out.println("Invalid input");
        }
       
       
    }
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions