Coding Quiz Zone
1.56K subscribers
18 photos
7 links
✨ Part Of @OfficialCodingExpert

Dive into the world of computer science, programming, and coding challenges. Sharpen your skills, expand your knowledge, and embark on a journey of continuous learning. Stay tuned for daily quizzes!
Download Telegram
<?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);
?>
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";
}
}
?>
<?php
define("GREETING", "PHP is a scripting language");
echo $GREETING;
?>
Coding Quiz Zone
<?php define("GREETING", "PHP is a scripting language"); echo $GREETING; ?>
What will be the output of the following PHP code?
Anonymous Quiz
13%
a) $GREETING
50%
b) no output
38%
c) PHP is a scripting language
0%
d) GREETING
A function in PHP which starts with __ (double underscore) is known as __________
Anonymous Quiz
0%
a) Default Function
71%
b) User Defined Function
14%
c) Inbuilt Function
14%
d) Magic Function
class UnsafeCode
{
static void Main()
{
int count = 100;
int? result = null;
int incr = 10;
result = count + incr;
if (result.HasValue)
Console.WriteLine("result has this value: " + result.Value);
else
Console.WriteLine("result has no value");
Console.ReadLine();
}
}
class UnsafeCode
{
static void Main()
{
int? count = null;
int? result = null;
int incr = 10;
result = count + incr;
if (result.HasValue)
Console.WriteLine("result has this value: " + result.Value);
else
Console.WriteLine("result has no value");
Console.ReadLine();
}
}
To retrieve the character at index 3 from string s=”Hello” what command do we execute (multiple answers allowed)?
Anonymous Quiz
0%
a) s[]
50%
b) s.getitem(3)
38%
c) s.__getitem__(3)
13%
d) s.getItem(3)
To return the length of string s what command do we execute?
Anonymous Quiz
20%
a) len(s) OR s.__len__()
60%
b) len(s) only
20%
c) size(s)
0%
d) s.size()
If a class defines the __str__(self) method, for an object obj for the class, you can use which command to invoke the __str__ method.
Anonymous Quiz
20%
a) obj.__str__()
60%
b) str(obj)
10%
c) print obj
10%
d) all of the mentioned
A programming technique in which the focus is on doing things.
Anonymous Quiz
17%
a) object oriented
25%
b) procedural
50%
c) logical
8%
d) structural
A procedural programming follows ___________ approach.
Anonymous Quiz
45%
a) top-down
27%
b) bottom-up
27%
c) left-right
0%
d) right-left
A basic unit of object-oriented programming.
Anonymous Quiz
8%
a) module
8%
b) block
83%
c) object
0%
d) token