×

# getting wrong answer as output after submission ! Suggest some test cases

getting wrong answer as output after submitting the code for prime palindrome problem..don't know why...cannot find any negative test cases...it's irritating when you can't find out the reason. please help.

link to the problem : http://www.codechef.com/problems/PRPALIN

code :

# include <stdio.h>

int main(void) { int n,m,i,j,count,n2,c; scanf("%d",&n);

for(i=n;i<=1000000;i++)
{   count=0;
for(j=1;j<=i;j++)
{
if(i%j==0)
{
count++;
}
}

if(count==2)
{
c=0;n2=0;m=i;
while(i>0)
{
c=i%10;
i=i/10;
n2=(n2*10)+c;
}
i=m;
if(m==n2)
{
printf("%d",m);
break;
}

}
}
return 0;


}

please suggest some negative test cases as soon as possible

1
accept rate: 0%

 0 Your code do not run on this test case: Input: 1000000 Output: [BLANK]  Try to Debug the solution.. :) answered 22 Mar '15, 07:06 1.9k●1●12●43 accept rate: 14%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×198
×51
×5
×4

question asked: 22 Mar '15, 01:28

question was seen: 896 times

last updated: 22 Mar '15, 07:06