You are not logged in. Please login at www.codechef.com to post your questions!

×

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

asked 22 Mar '15, 01:28

ratnadeep_n's gravatar image

0★ratnadeep_n
1
accept rate: 0%


Your code do not run on this test case:

Input:
1000000

Output: [BLANK]

alt text


Try to Debug the solution.. :)

link

answered 22 Mar '15, 07:06

rishabhprsd7's gravatar image

2★rishabhprsd7
1.9k11243
accept rate: 14%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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