#!/usr/bin/perl use warnings; use strict; print " Enter a number between 0 to 256 : "; my $dec = ; my $a = ($dec & 128) <=> 0; my $b = ($dec & 64) <=> 0; my $c = ($dec & 32) <=> 0; my $d = ($dec & 16) <=> 0; my $e = ($dec & 8) <=> 0; my $f = ($dec & 4) <=> 0; my $g = ($dec & 2) <=> 0; my $h = ($dec & 1) <=> 0; print " The entered decimal number in binary is : ",$a.$b.$c.$d.$e.$f.$g.$h," \n";