Which of these access specifiers must be used for class so that it can be inherited by another subclass?
Anonymous Quiz
0%
a) public
38%
b) private
63%
c) both public & private
0%
d) none of the mentioned
class test
{
public int a;
public int b;
public test(int i, int j)
{
a = i;
b = j;
}
public void meth(test o)
{
o.a *= 2;
o.b /= 2;
}
}
class Program
{
static void Main(string[] args)
{
test obj = new test(10, 20);
obj.meth(obj);
Console.WriteLine(obj.a + " " + obj.b);
Console.ReadLine();
}
}
Coding Quiz Zone
class test { public int a; public int b; public test(int i, int j) { a = i; b = j; } public void meth(test o) { o.a *= 2; o.b /= 2; } } class Program { static voidβ¦
What will be the output of the following C# code snippet?
Anonymous Quiz
13%
a) 20, 40
75%
b) 40, 20
0%
c) 20, 10
13%
d) 10, 20
Accessibility modifiers defined in a class are?
Anonymous Quiz
13%
a) public, private, protected
25%
b) public, internal, protected internal
63%
c) public, private, internal, protected internal
0%
d) public, private, protected, internal, protected internal
Who is the father of PHP?
Anonymous Quiz
0%
a) Drek Kolkevi
78%
b) Rasmus Lerdorf
22%
c) Willam Makepiece
0%
d) List Barely
Which of the following is the correct syntax to write a PHP code?
Anonymous Quiz
0%
a) <?php ?>
63%
b) < php >
38%
c) < ? php ?>
0%
d) <? ?>
Which of the following is the correct way to add a comment in PHP code?
Anonymous Quiz
0%
a) #
67%
b) //
22%
c) /* */
11%
d) All of the mentioned
Which of the following is the default file extension of PHP files?
Anonymous Quiz
33%
a) .php
56%
b) .ph
11%
c) .xml
0%
d) .html
<?php
$x = 10;
$y = 20;
if ($x > $y && 1||1)
print "1000 PHP MCQ" ;
else
print "Welcome to Sanfoundry";
?>
Coding Quiz Zone
<?php $x = 10; $y = 20; if ($x > $y && 1||1) print "1000 PHP MCQ" ; else print "Welcome to Sanfoundry"; ?>
What will be the output of the following PHP code?
Anonymous Quiz
43%
a) no output
43%
b) Welcome to Sanfoundry
14%
c) 1000 PHP MCQ
0%
d) error
Which is the right way of declaring a variable in PHP?
Anonymous Quiz
0%
a) $3hello
63%
b) $_hello
25%
c) $this
13%
d) $5_Hello
<?php
$fruits = array ("apple", "orange", array ("pear", "mango"),"banana");
echo (count($fruits, 1));
?>
Coding Quiz Zone
<?php $fruits = array ("apple", "orange", array ("pear", "mango"),"banana"); echo (count($fruits, 1)); ?>
What will be the output of the following PHP program?
Anonymous Quiz
0%
a) 6
71%
b) 5
29%
c) 4
0%
d) 3
<?php
function multi($num)
{
if ($num == 3)
echo "I Wonder";
if ($num == 7)
echo "Which One";
if ($num == 8)
echo "Is The";
if ($num == 19)
echo "Correct Answer";
}
$can = stripos("I love php, I love php too!","PHP");
multi($can);
?>
Coding Quiz Zone
<?php function multi($num) { if ($num == 3) echo "I Wonder"; if ($num == 7) echo "Which One"; if ($num == 8) echo "Is The"; if ($num == 19) echo "Correct Answer"; }β¦
What will be the output of the following PHP program?
Anonymous Quiz
0%
a) Correct Answer
57%
b) Is The
29%
c) I Wonder
14%
d) Which One
Which of the following PHP functions can be used for generating unique ids?
Anonymous Quiz
0%
a) md5()
57%
b) uniqueid()
43%
c) mdid()
0%
d) id()
<?php
class Example
{
public $name;
function Sample()
{
echo "Learn PHP @ Sanfoundry";
}
}
?>
Coding Quiz Zone
<?php class Example { public $name; function Sample() { echo "Learn PHP @ Sanfoundry"; } } ?>
In the following PHP program, what is/are the properties?
Anonymous Quiz
0%
a) function sample()
57%
b) echo βThis is an exampleβ;
43%
c) public $name;
0%
d) class Example