if(a<b && b<c)
    {return a;}
    if(b<a && b<c)
    {return b;}
    {return c;}

so thats what i wrote trying to get a minimum of 3 numbers.... and it didnt pass testing

asked 31 Jul '17, 18:09

Vudek's gravatar image

accept rate: 0%

edited 31 Jul '17, 18:11

public static int min(int a, int b, int c) { int m3; if(a<b) m3="a;" if(b<c)="" m3="b;" if(c="">a) m3=c; else m3=c; return m3;//add your code here }

tried this but also doesnt work please some hints help

(01 Aug '17, 03:10) Vudek

if(a<b && b<c)

What if b=c? Try:

if(a<b && a<c)

answered 01 Aug '17, 03:16

YourDoom's gravatar image

accept rate: 35%

edited 01 Aug '17, 03:18

tried this also doesnt work if i tried if(b=c) it returns error required boolean, if(b==c) didnt pass testing but compiles fine

(01 Aug '17, 03:20) Vudek

thx for help

(01 Aug '17, 03:25) Vudek

so it worked finally thx for help it seems i need to think more logically next time >.>

this code worked for me

if(a<b && a<c) {return a;} if(b<a && b<c) {return b;} else {return c;}


answered 01 Aug '17, 03:24

Vudek's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

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

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



Asked: 31 Jul '17, 18:09

Seen: 165 times

Last updated: 01 Aug '17, 03:25