Help for this page

Select Code to Download


  1. or download this
    my $bin1;
    if ($binc1 != 0) {
    ...
    } else {
       $bin1 = 0;
    }
    
  2. or download this
    my $bin1;
    if ($binc1 == 0) {
    ...
    } else {
       $bin1 = 1;
    }
    
  3. or download this
    my $bin1;
    if ($binc1) {
    ...
    } else {
       $bin1 = 0;
    }
    
  4. or download this
    my $bin1 = $binc1 ? 1 : 0;
    
  5. or download this
    my $bin1 = $binc1 ? '1' : '0';
    
  6. or download this
    print "The number in binary is: ", ($binc1 ? '1' : '0'), "\n";