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

atm getting wrong answer

$
0
0

Here, is my code and i am continuously getting wrong answer and cannot find the reason why.. Please help?

import java.util.Scanner;

public class Main { public static void main(String args[]) { Scanner input=new Scanner(System.in); double x=input.nextDouble(); double y=input.nextDouble(); if(((x+0.50)>=y)||(x%5!=0)) System.out.println(y); else { double bal=y-x-0.50; System.out.println("Successful Transaction"); System.out.println(bal); } } }


Viewing all articles
Browse latest Browse all 40121

Trending Articles



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