You are not logged in. Please login at www.codechef.com to post your questions!

×

Why am i getting nzec..plz help

import java.util.Scanner; class Bank {

public static void main(String arr[]){ Scanner meo = new Scanner(System.in); int withdraw=0;float balance=0; withdraw=meo.nextInt(); balance=meo.nextFloat(); if((withdraw+.5>balance)||(withdraw%5!=0)) System.out.printf("%d",balance); else System.out.printf("%.2f",balance-withdraw-.50); }}

asked 14 Aug '14, 23:05

srivatsarao's gravatar image

0★srivatsarao
11
accept rate: 0%


check this line--> System.out.printf("%d",balance)
balance is float

link

answered 14 Aug '14, 23:13

ravi0213's gravatar image

4★ravi0213
2.2k41324
accept rate: 14%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,507
×399
×189

question asked: 14 Aug '14, 23:05

question was seen: 485 times

last updated: 14 Aug '14, 23:13