This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$filename= "index.txt"; | |
$handle = fopen($filename, "r"); | |
$contents = fread($handle, filesize($filename)); | |
fclose($handle); | |
$input= explode("\n",$contents); | |
foreach($input as $num){ | |
$factorial = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function primefactor($num) { | |
$sqrt = sqrt($num); | |
for ($i = 2; $i <= $sqrt; $i++) { | |
if ($num % $i == 0) { | |
return array_merge(primefactor($num/$i), array($i)); | |
} | |
} | |
return array($num); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$input= file_get_contents('index.txt'); | |
$array= explode("\n",$input); | |
foreach($array as $std){ | |
if(strrev($std)== $std){ | |
echo $std. ' -- is regular palindrome'.'<br>'; | |
}else{ | |
echo $std. ' -- is not regular palindrome'.'<br>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var first_number = prompt('Please enter first value',''); | |
var second_number = prompt('Please enter second value',''); | |
var i; | |
var maxCount = 1; | |
for(i = first_number; i <= second_number; i ++) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var n= prompt('Please enter the value',''); | |
var i=1; | |
document.write(n); | |
document.write(" For "); | |
while(n != 1) | |
{ | |
if(n % 2 == 0) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //echo "dfaf afa";?> | |
<?php | |
//$palindrome= 'madam'; | |
function palindrome($palindrome){ | |
$split= strrev($palindrome); | |
$split1=str_split($palindrome); | |
$split2=array_unique($split1); | |
if($split){ | |
echo $palindrome. ' is palindrome'; |