Page 2 of 2 FirstFirst 12
Results 21 to 24 of 24
  1. #21
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,317
    Rep Power
    25

    Default

    Also use variable names that have meaning when you look at them.
    n1 and n2 have no meaning.

  2. #22
    Libertyman is offline Member
    Join Date
    Jun 2010
    Posts
    26
    Rep Power
    0

    Default

    if(n1 > max) {max = n1;}


    i added a max variable = 0..

    how do i transfer this if function to Trilinear operator,

    the if works, but i am not allowed to use if

  3. #23
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,317
    Rep Power
    25

    Default

    transfer this if function to Trilinear operator
    What is the syntax for trilinear statement:
    var = (condition exp) ? if-true-val : if-false-val;

    If the condition exp is true return the new value , if false return the current value of the var

  4. #24
    Libertyman is offline Member
    Join Date
    Jun 2010
    Posts
    26
    Rep Power
    0

    Default

    yeah, i got it earlier. on

    i placed the max var = then the rest

    ..

Page 2 of 2 FirstFirst 12

Similar Threads

  1. What are you using to write your code?
    By CaptainMorgan in forum New To Java
    Replies: 991
    Last Post: 08-22-2014, 06:35 PM
  2. Replies: 57
    Last Post: 07-15-2010, 04:10 AM
  3. How To Write Unmaintainable Code
    By tim in forum Forum Lobby
    Replies: 2
    Last Post: 02-07-2010, 09:19 PM
  4. Can I write code in 2 different files ?
    By fartek in forum New To Java
    Replies: 2
    Last Post: 02-14-2009, 03:48 PM
  5. Help me to write a secure code
    By Bhavis in forum Advanced Java
    Replies: 4
    Last Post: 01-21-2009, 06:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •