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

C code for the ATM question does not work :(

$
0
0

include<stdio.h>

int main() { float Y; int X; //printf("Enter the available amount : "); scanf("%f",&Y); //printf("Enter the amount to be withdrawal : "); scanf("%d",&X); if((Y>=0&&Y<=2000)&&(X>0&&X<=2000)){ if((Y>=X+0.50)&&(X%5==0)){ Y=Y-X-0.5; printf("%.2f",Y); } else printf("%.2f",Y); } return 0;
}

what is wrong with this code ? codechef is showing the result WRONG ANSWER , even its working correctly in my pc


Viewing all articles
Browse latest Browse all 40121

Trending Articles



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