Showing posts from January, 2017
This is a very general question of any interview in any programming language. But most of the developers not aware about the logic of this question. Below is the solution of it see - $first = 10; $second = 20; echo "Before swapping the nu…
Suppose we have an array $numbers with some random numbers like below. Now we need to find the largest element of this array. $numbers = array(12,23,45,20,5,6,34,17,9,56,999); $length = count($numbers); $max = $numbers[0]; for($i=1;$…
This is a very general interview question of any interview in programming $first = 0; $second = 1; for($i=0;$i<=10;$i++){ $third = $first+$second; echo $third.' '; $first = $second; $second = $third; } Output …
Suppose $inputArray is our array which have some repeated elements. $inputArray = array(1, 4, 2, 1, 6, 4, 9, 7, 2, 9); $outputArray = array(); foreach($inputArray as $inputArrayItem){ foreach($outputArray as $outputArrayItem) { if(…
Answers of all these questions must be in your mind before going to attend an interview in angular js. These are a basics questions but we ignore its to think that these are a basic question : Question: What is Angular.js? Answer: AngularJS is a…