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

×

whats wrong in this code and why its showing me wrong answer

import java.util.*;

class chef { public static void main(String[] args) { int a,b,c; Scanner sc=new Scanner(System.in); try{ a=sc.nextInt(); b=sc.nextInt(); c=sc.nextInt(); int res1=(int)(-b+Math.sqrt(bb-4ac))/(2a); int res2=(int)(-b-Math.sqrt(bb-4ac))/(2a);

     System.out.println(res1);
     System.out.println(res2);
}
catch(Exception e)
{
     ;
}

}

}

asked 14 Oct '18, 14:29

harish_2503's gravatar image

0★harish_2503
1
accept rate: 0%

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:

×145

question asked: 14 Oct '18, 14:29

question was seen: 88 times

last updated: 14 Oct '18, 14:29