Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

whats the mistake...??? (ATM)

$
0
0
#include<stdio.h>
int main()
{
float amt,rmn,f;
int wd;

scanf("%d %f", &wd, &amt);

if(amt<=0 || wd<0)
{
exit(0);
}

if(wd%5==0 && amt>wd && wd>=0)
{
f=(float)wd + 0.50;
rmn=amt-f;
printf("%.2f\n",rmn);
}
else
{
printf("%.2f\n",amt);
}

return 0;
}

Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>