import java.io.*;
class pair
{
public static void main(String args[])throws IOException
{ int n=0;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("entre any number");
n=Integer.parseInt(br.readLine());
int c1=0;
int c=0;
int t=0;
int a[]=new int[n];
if(n%2==0&&n>9&&n<50)
{
for(int i=2;i<=n;i++)
{
for(int j=1;j<=i;j++)
{
if(i%j==0)
{
c=c+1;
}
}
if(c==2)
{
a[t++]=i;
c1=c1+1;
}
c=0;
}
for(int i=0;i<=c1/2;i++)
{
int k=a[i];
for(int j=0;j<=c1;j++)
{
if(k+a[j]==n)
{
System.out.print(k+","+a[j]);
}
}
System.out.println();
}
}
else
System.out.println("given number is odd");
}
}
No comments:
Post a Comment
HAY THAKYOU FOE VISIT