Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...




If the variable $a is equal to 5 and variable $b is equal to
character a, what’s the value of $$b?

Can anyone explain how's the value of $$b=100

Answers were Sorted based on User's Feedback



If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / joydeep

Given $a = 5;
$b = 'a';

So, $$b = $($b) = $a = 5

Simple, there is no concept of ASCII is applicable here....
For more Web Tech Info contact me.........Joydeep

Is This Answer Correct ?    79 Yes 12 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / jasmeet

Firstly wehave assigned that:
$a=5;
and now we have:
$b=a; //as it has said that $b= character 'a' whose ascii
value=95.

Now we need $$b;
so thw answer becomes:
$$b => $(95).
here 95 will again used as an ascii value and it will
call 'a'.
So the result comes out be 5.
not 100.
Check before writing any silly Question.
for any more doubts contact:: Jasmeet.

Is This Answer Correct ?    49 Yes 24 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / rakesh r

$a = 5
$b = 'a'
$$b = ?

$b value is a
so, $$b = $a = 5
hence, ans is 5

Is This Answer Correct ?    23 Yes 2 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / adesh suryan

Create new file and save it as .php extension and execute
this file then You find the answer of this question , copy
below code as:
<?php
$a=5;
echo $b=a.'<br/>';
echo $$b;
?>
output:
1.a
2.5

Is This Answer Correct ?    17 Yes 1 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / webguy

It would be great if you posy questions that are easy to
understand, something like,

Let's say:
$a = 5;
$b = 'a';

Now what's the value of $$b?

$bb = $a = 5;

so the answer is 5 and not 100.

Is This Answer Correct ?    16 Yes 2 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / deepa

because given
$a = 5
$b = 'a'
$$b = ?
so,
$b has value as a in char
so, $$b = $($b) = $(a) = $a = 5
hence, answer is 5.This ans is 100% correct,if anyone has
any doubt,jst contact me at ishika21114@gmail.com

Is This Answer Correct ?    13 Yes 0 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / php don

All guys who are saying ans is 100 are not good in programming.
The right answerer is 5 so guys don't put wrong answerers
and to the guys who are referring plz do check this code its
simple to find out by yourself then to believe this stupids
who say its reference and 100 actual answer is 5 and not 100
<?php
$a=5;
$b="a";
echo $$b;
?>

Is This Answer Correct ?    5 Yes 3 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / birend gupta

<?php
$a=5;
$b='a';
echo $$b;
?>

Output : 5

Is This Answer Correct ?    2 Yes 0 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / sandhya

If the $a is equal to 5 and $b is equal
to character a,so

$a=5;

$b="a";


$$b = $( $b ) = $ ( 'a' ) = $a = 5 ;

Of course Answer should be 5 !!

Is This Answer Correct ?    2 Yes 0 No

If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of..

Answer / adeshsuryan

Correct format of this program is following check out this:
<?php
$a=5;
echo $b=a;
echo $$b;

?>
Dear Annonymus : You assign a constant in $$b not character.
your code is echo $b='a'."<br/>";
where 'a' treats as constant .but above a is a variable
keep this thing in mind.

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More PHP Interview Questions

How to execute a php script from the command line?

0 Answers  


Do you know what is the use of rand() in php?

0 Answers  


What are the two types of variables?

0 Answers  


I have written a source code in php but I do not know how to compile that and conduct it with a website please explain me the how to compile that ?

1 Answers  


What is difference between post and put in rest?

0 Answers  


"$this" what type of object it is?

2 Answers  


How to redirect https to http url and vice versa in .htaccess?

0 Answers  


How to find a substring from a given string in php?

0 Answers  


How can you declare a constant variable in php?

0 Answers  


how to change the div background color on every refresh..guys can u help me out.

3 Answers  


Explain the difference between require() and require_once()?

0 Answers  


Why are sessions used?

0 Answers  


Categories