# Why do I keep on getting "wrong answer"?

**URL:** <https://discuss.codechef.com/t/why-do-i-keep-on-getting-wrong-answer/34803>\
**Category:** faq\
**Tags:** faq\
**Created:** [August 15, 2019, 6:20pm UTC](https://discuss.codechef.com/t/why-do-i-keep-on-getting-wrong-answer/34803 "2019-08-15T18:20:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhavyaaverma](https://discuss.codechef.com/user_avatar/discuss.codechef.com/bhavyaaverma/32/5749_2.png) [@bhavyaaverma](https://discuss.codechef.com/u/bhavyaaverma)\
**Post date:** [August 15, 2019, 6:20pm UTC](https://discuss.codechef.com/t/why-do-i-keep-on-getting-wrong-answer/34803/1 "2019-08-15T18:20:51Z")

</div>

#include\<stdio.h\>  
int main(void){  
int x;  
float y;  
scanf("%d %f",&x,&y);  
if(x\<=2000 && y\<=2000 && x\>0 && y\>=0)  
{  
if(x\>y)  
printf("%0.2f",y);  
else if(x%5==0)  
printf("%0.2f",(y-x-0.5));  
else  
printf("%0.2f",y);  
}  
return 0;  
}

This is my code and I have tested it on codeblocks IDE and it is working fine but codechef is not accepting my code

---

<div class="post-metadata">

**Author:** ![s5960r](https://discuss.codechef.com/user_avatar/discuss.codechef.com/s5960r/32/9612_2.png) [@s5960r](https://discuss.codechef.com/u/s5960r)\
**Post date:** [August 15, 2019, 6:31pm UTC](https://discuss.codechef.com/t/why-do-i-keep-on-getting-wrong-answer/34803/2 "2019-08-15T18:31:26Z")

</div>

Your answer is incorrect. You need to check an extra condition! Try some cases and you’ll see where it fails 🙂

---

<div class="post-metadata">

**Author:** ![ssrivastava990](https://discuss.codechef.com/user_avatar/discuss.codechef.com/ssrivastava990/32/216836_2.png) [@ssrivastava990](https://discuss.codechef.com/u/ssrivastava990)\
**Post date:** [August 15, 2019, 6:34pm UTC](https://discuss.codechef.com/t/why-do-i-keep-on-getting-wrong-answer/34803/3 "2019-08-15T18:34:55Z")

</div>

For which question…??

---

<div class="post-metadata">

**Author:** ![s5960r](https://discuss.codechef.com/user_avatar/discuss.codechef.com/s5960r/32/9612_2.png) [@s5960r](https://discuss.codechef.com/u/s5960r)\
**Post date:** [August 15, 2019, 6:38pm UTC](https://discuss.codechef.com/t/why-do-i-keep-on-getting-wrong-answer/34803/4 "2019-08-15T18:38:08Z")

</div>

His last submission shows ATM so i assumed that
