Monday, February 21, 2011

SOLUTION OF QUESTION 1

import java.io.*;

class numcombi

{

String str="";

int a=0;

int b=0;

public void combi() throws IOException

{

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter a number : ");

int num = Integer.parseInt(br.readLine());

System.out.println("Combinations :");

for(int i=1;i<=num/2;i++)

{

str="";

extract(num,i);

}

}

public void extract(int n, int m)

{

a=m;

str+=" "+a;

b=n-a;

System.out.println(str+" "+b);

if(b<=m)

{

return;

}

extract(b,m);

}

public static void main(String arg[]) throws IOException

{

numcombi obj= new numcombi();

obj.combi();

}

}

Saturday, February 19, 2011

Changes are good

Now access to the web page https://sites.google.com/site/javaprogramsisc/ is purely on invitation. So use your gmail id to send request and you will receive link for the web page

Sunday, February 13, 2011

Sunday, January 30, 2011


I am back.
If any questions ask me.