I tried to give a solution to this problem in C language.
Here below is my code:
#include <stdio.h>
int main()
{
int x;
float y;
printf(“Input:\n”);
scanf("%d %f",&x,&y);
if((0<x && x<=2000) && (0<=y &&y<=2000.00))
{ printf(“Output:\n”);
if(x%5==0 && (float)x<=y)
printf("%.2f",y-x-0.50);
else
printf("%.2f",y); }
else
exit(1);
return 0;
}
Please point out the error that I have made.
You have not covered all the edge cases.
1 Like
Thank you very much. I corrected it after this post, but even then it showed error. But later I realized that I shouldn’t display “Input” , “Output”.
Thank you very much.
CodeChef has many beautiful Discuss Forum features. This tutorial is for introducing newcomers to the various formatting that are available in CC Discuss. I’ve seen individual tutorials on formatting code or equations, but no topic on the entire available options. So I’m writing this topic for it to be that one place with all available formatting.
Basic:
The very basic formatting such as Boldface or Italics are available in GUI, and just a click away. You can also use ** text ** for boldface an…
Please format your code next time