Hi, I want to get output as 0x23400000345....

in the below example How to get?

i tried out, but unable to get the answer

$r=0x234;

$t=0x345;

$y=pack(L L,$t,$r);

$x1=unpack(L!,pack(P,$y));

printf("
The value is $x1");

I didnt get constant output?



Hi, I want to get output as 0x23400000345.... in the below example How to get? i tried out, bu..

Answer / chaitu

use the following code.

<code>

use bigint;

my $r = 0x234;

my $t = 0x345;

my $x1 = $r << 32 | $t;

print $x1->as_hex;

</code>

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More CGI Perl Code Interview Questions

write a program which asks the user for a digit INTEGER and outputs show in 5 digit . example user enter :89 and output should be 00089

1 Answers  


Write a program which asks user for digit and output as 5 digit number (prefix as 0). example : 89 o/p should be 00089

1 Answers  


Hi, I want to get output as 0x23400000345.... in the below example How to get? i tried out, but unable to get the answer $r=0x234; $t=0x345; $y=pack(L L,$t,$r); $x1=unpack(L!,pack(P,$y)); printf(" The value is $x1"); I didnt get constant output?

1 Answers  


Categories
  • PHP Code Interview Questions PHP Code (33)
  • JSP Code Interview Questions JSP Code (6)
  • ASP Code Interview Questions ASP Code (5)
  • CGI Perl Code Interview Questions CGI Perl Code (3)
  • JavaScript Code Interview Questions JavaScript Code (63)
  • VB Script Code Interview Questions VB Script Code (20)
  • Shell Script Code Interview Questions Shell Script Code (31)
  • Python Code Interview Questions Python Code (34)
  • WinRunner Code Interview Questions WinRunner Code (1)
  • HTML DHTML XHTML Code Interview Questions HTML DHTML XHTML Code (13)
  • XML Interview Questions XML (43)
  • Scripts_Markup Code AllOther Interview Questions Scripts_Markup Code AllOther (5)