Home / Rati Dubey / Programming MCQs Solution

Programming Portal Solution

You will find all Programming Portal MCQs whose solution is updated by Rati Dubey

Q. Which function returns the absolute value of a number in Python?

Q. What is the output of `print(3 == 3.0)`?

Q. Which keyword is used to declare a function that does nothing in Python?

Q. Which of these functions is used to display output in Python?

Q. Which of the following is used to install external packages in Python?

Q. What is the output of `print('A' in 'Apple')`?

Q. Which keyword is used to define a generator function in Python?

Q. Which of the following functions can be used to sort a list in Python?

Q. Which statement is used to define a block of code that runs only when the program is executed directly, not when imported?

Q. What is the output of `print(type(True))`?

Q. Which function is used to convert a number into a string in Python?

Q. Which function is used to read a line from a file in Python?

Q. Which of the following is an immutable data type?

Q. What is the output of `print(5 / 2)`?

Q. What is the output of `print(5 // 2)`?

Q. Which keyword is used to skip the current iteration in a loop?

Q. Which keyword is used to exit from a loop in Python?

Q. Which built-in function returns the length of an object in Python?

Q. What is the output of `print(type((1,)))`?

Q. Which of the following keywords is used to create an anonymous function in Python?

Q. Which function is used to convert a string into lowercase in Python?

Q. Which of the following data types is ordered in Python?

Q. What is the correct way to write a for loop in Python?

Q. Which built-in function is used to find the maximum value in Python?

Q. Which operator is used for floor division in Python?

Q. Which function is used to get the ASCII value of a character in Python?

Q. What is the output of `print(type({}))`?

Q. Which of the following is used to handle exceptions in Python?

Q. What is the default return value of a Python function that does not explicitly return anything?

Q. What is the output of `print('Hello' * 3)`?

Q. Which of these is the correct syntax for a dictionary in Python?

Q. Which keyword is used to create a class in Python?

Q. What is the correct way to open a file for reading in Python?

Q. What will `print(bool(0))` return?

Q. Which of the following is a mutable data type in Python?

Q. What is the output of `print(2 ** 3)`?

Q. Which function is used to get user input in Python 3?

Q. Which symbol is used for single-line comments in Python?

Q. What does the `len()` function do in Python?

Q. Which keyword is used to define a function in Python?

Q. Which of the following is the correct file extension for Python files?

Q. Which of the following is true about PHP constants?

Q. Which of the following is used to open a file for writing in PHP?

Q. In PHP, which symbol is used to declare variables?

Q. Which of the following is not a magic constant in PHP?

Q. Which PHP version introduced namespaces?

Q. What is the default method used in HTML forms if method is not specified?

Q. Which function is used to destroy a session in PHP?

Q. Which of the following is true about PHP arrays?

Q. Which function is used to include a file in PHP that gives a warning if the file is missing but continues execution?

Q. What is the default return type of var_dump()?

Q. Which of the following is a superglobal in PHP?

Q. What will echo 5 == "5"; output?

Q. Which operator is used for concatenating strings in PHP?

Q. Which MySQLi function closes the database connection?

Q. Which function is used to fetch all rows from a PDO statement?

Q. Which SQL injection prevention technique is recommended in PHP?

Q. Which PHP function returns the last inserted ID in a PDO connection?

Q. Which of the following is a correct way to connect to MySQL using PDO?

Q. Which function is used to fetch a row as an associative array in MySQLi?

Q. Which MySQLi function is used to execute an SQL query?

Q. Which function is used to delete a cookie in PHP?

Q. Which PHP function is used to move an uploaded file to a new location?

Q. Which attribute is required in an HTML form to enable file upload in PHP?

Q. Which PHP superglobal is used to handle file uploads?

Q. Which function is used to escape special characters in a string for use in an SQL statement with MySQLi?

Q. Which PDO fetch style returns results as an associative array?

Q. Which PDO method is used to execute a prepared statement?

Q. Which PDO method is used to prepare an SQL statement?

Q. Which function is used to connect to a MySQL database using MySQLi (procedural)?

Q. Which PHP extension is most commonly used for database interaction with MySQL?

Q. Which function is used to restore a serialized object in PHP?

Q. Which PHP function is used to serialize an object?

Q. Which PHP feature allows multiple classes to use the same code without inheritance?

Q. Which function is used to get the name of the current class inside it?

Q. What will happen if an exception is not caught in PHP?

Q. Which keyword is used to throw an exception in PHP?

Q. Which block is used to handle exceptions in PHP?

Q. Which of the following exceptions is the base class for all exceptions in PHP?

Q. Which of the following is true about static methods in PHP?

Q. Which keyword is used inside a class to use a trait?

Q. Which keyword is used to declare a trait in PHP?

Q. Which function is used to check if a class exists in PHP?

Q. Which keyword is used to call the parent class constructor?

Q. Which keyword is used to prevent a class from being inherited in PHP?

Q. What is the difference between abstract classes and interfaces in PHP?

Q. Which of the following visibility keywords are supported in PHP OOP?

Q. Which of the following is true about PHP variables?

Q. Which PHP function is used to count all elements in an array, including nested arrays?

Q. Which function is used to redirect a user to another page in PHP?

Q. Which operator is used to assign by reference in PHP?

Q. What will be the result of: echo 10 / 3; ?

Q. Which of the following functions is used to get the current script name in PHP?

Q. Which of the following functions is used to hash a string in PHP?

Q. Which of the following is NOT a valid magic constant in PHP?

Q. Which of the following is used to terminate script execution in PHP?

Q. Which function is used to check if a variable is set in PHP?

Q. Which of the following is the correct way to get the number of elements in an array?

Q. Which of the following functions is used to open a file in PHP?

Q. Which of the following is used to destroy a PHP session?

Q. Which function is used to sort an array in ascending order in PHP?

Q. What is the default value of variables in PHP if not initialized?

Q. Which of the following is a PHP array type?

Q. Which PHP function is used to get the type of a variable?

Q. Which of the following is the correct way to write a single-line comment in PHP?

Q. Which operator is used for strict comparison (value and type) in PHP?

Q. Which of the following functions is used to output text in PHP?

Q. Which of the following functions is used to include a file in PHP?

Q. What will be the output of: echo 5 . 3; ?

Q. Which superglobal variable is used to collect form data sent with the POST method?

Q. Which command displays the contents of a file in HDFS?

Q. Which language is Hadoop primarily written in?

Q. What is speculative execution in MapReduce?

Q. How does a client read data from HDFS?

Q. Which Apache project provides a RESTful API to interact with HDFS?

Q. Which one is not a valid feature of Hadoop?

Q. Which of the following uses HDFS for storage?

Q. What is the function of 'fsimage' in Hadoop?

Q. Which of these is a high-level scripting platform in Hadoop?

Q. Which feature of Hadoop ensures continued service during hardware failure?

Q. Which Hadoop ecosystem tool is best for iterative machine learning tasks?

Q. Which daemon in Hadoop 2.0 is responsible for job scheduling?

Q. How are keys and values written in MapReduce output?

Q. Which of the following tools is used to import data from MySQL to HDFS?

Q. What is the default replication factor in Hadoop 3.x?

Q. Which component in Hadoop decides how to split the input data?

Q. In YARN, what is the function of the ResourceManager?

Q. Which file format in Hadoop is splittable and compressed?

Q. What is the role of Secondary NameNode in Hadoop?

Q. What happens if the NameNode crashes in an HDFS cluster?

Q. Which statement will stop the execution of a loop?

Q. What will be the output of var_dump(0 == '0')?

Q. Which PHP function is used to redirect users to another page?

Q. Which magic constant represents the current file name?

Q. Which function would you use to get the last error occurred?

Q. Which of the following is not a valid PHP superglobal?

Q. Which of the following functions can be used to escape special characters in a string for use in an SQL statement?

Q. Which error type in PHP is unrecoverable and stops script execution?

Q. Which of the following is a correct way to create an array in PHP?

Q. Which operator is used to concatenate strings in PHP?

Q. Which function is used to decode JSON data in PHP?

Q. Which of these functions is used to read a file into an array?

Q. Which symbol is used for single-line comments in PHP?

Q. Which of the following functions is used to start a session in PHP?

Q. What does the 'global' keyword do in a function?

Q. What is the output of var_dump(null == false)?

Q. Which global array stores values passed via URL or a form using GET method?

Q. Which function is used to remove duplicate values from an array?

Q. Which of the following is not a PHP data type?

Q. Which magic method is called when an object is destroyed?

Q. What will be the output of echo 3 + 2 * 2?

Q. Which error level is used for user-generated warnings?

Q. Which PHP keyword is used to implement an interface?

Q. Which function creates an array from variables and their values?

Q. What is the result of empty('0')?

Q. What does the keyword 'final' mean in a class method?

Q. Which function appends one array to another in PHP?

Q. Which function returns the number of elements in an array?

Q. Which keyword is used to define a constant in a class?

Q. Which function returns the type of a variable?

Q. What is the result of '5' === 5 in PHP?

Q. How can you destroy a PHP session?

Q. Which function is used to break a string into an array?

Q. What is the output of 5 == '5' in PHP?

Q. Which PHP function converts special characters to HTML entities?

Q. Which symbol is used to access variables in PHP?

Q. What is the default scope of a variable declared inside a function?

Q. Which statement is used to end execution of a script?

Q. Which function is used to delete a cookie?

Q. Which of the following is a valid loop in PHP?

Q. Which function is used to remove whitespace from the beginning of a string?

Q. How do you check if a file is readable?

Q. Which function is used to count array elements?

Q. What does the $_SERVER superglobal contain?

Q. Which function is used to redirect users to another page?

Q. What does the isset() function return if the variable is set?

Q. What will be the output of strlen('PHP')?

Q. Which keyword is used to define an abstract class in PHP?

Q. How do you access a static method in PHP?

Q. Which PHP function is used to send raw HTTP headers?

Q. Which of these is the correct way to create a comment block in PHP?

Q. Which of these functions is used to open a file in PHP?

Q. Which function is used to get the current Unix timestamp?

Q. Which function is used to sort an array in ascending order by value?

Q. Which of the following will check if a file exists?

Q. Which keyword is used to define a constant class member?

Q. Which function is used to merge arrays in PHP?

Q. Which PHP function is used to filter and validate user input?

Q. Which statement is used to create a constant array in PHP?

Q. How do you create an object in PHP?

Q. Which function is used to remove the last element from an array?

Q. Which of the following is used to define an interface in PHP?

Q. Which function is used to read a file into a string?

Q. Which operator is used to check if two values are not equal in PHP?

Q. Which function is used to hash passwords in PHP?

Q. Which superglobal holds uploaded file data?

Q. How can you prevent SQL injection in PHP?

Q. Which of the following function is used to send email using PHP?

Q. What will echo 10 + '5 days'; output?

Q. Which version of PHP introduced namespaces?

Q. What is the correct way to write a comment in PHP?

Q. Which PHP function is used to split a string into an array?

Q. Which function returns an array of array keys?

Q. What is the use of isset() function?

Q. Which superglobal is used to collect form data after submitting an HTML form with method GET?

Q. Which function is used to remove white spaces from both ends of a string?

Q. What does the === operator check in PHP?

Q. What does the strpos() function do?

Q. How do you define a constant in PHP?

Q. Which of these functions is used to redirect to another page in PHP?

Q. Which function is used to destroy a session?

Q. Which of these is used to terminate a PHP statement?

Q. What is the result of true && false in PHP?

Q. Which symbol is used to prepend a variable in PHP?

Q. Which of the following functions will return the current date in 'YYYY-MM-DD' format?

Q. Which function is used to send raw HTTP headers in PHP?

Q. Which of the following is a correct way to create an associative array?

Q. How do you access the first element of the array $arr = [10, 20, 30]?

Q. Which PHP function is used to start a session?

Q. Which of the following will output the type and value of a variable?

Q. What will the following code print?

Q. What is the use of the 'global' keyword in PHP?

Q. What will be the output?

Q. How can you get the number of elements in an array?

Q. Which of the following is NOT a valid PHP variable name?

Q. Which function checks if a variable is NULL?

Q. Which of these is used to handle exceptions in PHP?

Q. What will be the result of the following?

Q. How do you declare a PHP function named 'test'?

Q. What is the output of this code?

Q. What will be the output of the following code?

Q. Which of these functions can be used to connect to a MySQL database in PHP?

Q. Which function returns the type of a variable as a string?

Q. Which of the following is used to include code from another file and cause a fatal error if the file is missing?

Q. What is the scope of a variable declared outside a function in PHP?

Q. Which function is used to terminate the current script in PHP?

Q. What will the expression isset($var) return if $var is set to null?

Q. What does the PHP function substr() do?

Q. How do you declare a variable in PHP?

Q. How do you check if a variable is an array in PHP?

Q. Which function can be used to generate a random integer between two values?

Q. What is the purpose of the PHP function htmlspecialchars()?

Q. Which superglobal contains information about cookies?

Q. Which PHP function is used to open a directory handle?

Q. What is the result of the expression: false || true?

Q. Which keyword is used to declare a constant inside a class?

Q. Which function is used to get all keys from an array?

Q. What will be the output of the following code?

Q. Which of the following is the correct way to declare an array in PHP?

Q. Which function is used to start a PHP session?

Q. What will the following code output? <?php echo strpos('hello world', 'world'); ?>

Q. What does the PHP function trim() do?

Q. Which operator is used to check if two variables are identical in PHP?

Q. Which function is used to get the length of an array?

Q. Which of the following is used to declare a variable in PHP?

Q. Which PHP function returns the current Unix timestamp?

Q. Which of the following functions is used to include a file only once?

Q. Which of these is NOT a valid variable name in PHP?

Q. What is the output of the following? <?php $a = 'Hello'; $b = &$a; $b = 'World'; echo $a; ?>

Q. Which superglobal contains information about headers, paths, and script locations?

Q. Which function can be used to redirect to another page in PHP?

Q. How do you add a comment in PHP?

Q. Which of the following is a valid way to open a file for reading in PHP?

Q. What does the PHP function json_encode() do?

Q. Which function is used to serialize a PHP value into a storable representation?

Q. What will be the output of the following code? <?php echo 10 % 3; ?>

Q. Which of the following is the correct way to define a constant in PHP?

Q. Which function is used to start output buffering in PHP?

Q. Which PHP function can be used to safely output user input to prevent XSS attacks?

Q. Which function outputs information about a variable, including its type and value?

Q. Which of the following is a PHP magic method?

Q. What is the result of the expression: 3 == '3'?

Q. How can you remove an element from an array by its key?

Q. What will the function strlen('Hello World') return?

Q. Which keyword is used to define a class constant in PHP?

Q. Which function would you use to check if a file exists in PHP?

Q. How do you start a session in PHP?

Q. Which operator is used to concatenate two strings in PHP?

Q. What is the purpose of the PHP function isset()?

Q. Which of the following is the correct way to declare a function in PHP?

Q. Which PHP function is used to remove elements from the end of an array?

Q. What is the output of: echo '5' + 10;

Q. Which superglobal array is used to collect data sent via the GET method?

Q. Which function can be used to include and evaluate a specified file during runtime?

Q. What does the PHP function explode() do?

Q. How can you make a method accessible only within its own class and by inheriting classes?

Q. Which of the following keywords is used to inherit a class in PHP?

Q. Which of the following is the correct way to create an object in PHP?

Q. What is the default visibility of class members in PHP if none is specified?

Q. Which function checks if a variable is an array?

Q. Which of these is used to end the execution of a PHP script?

Q. What will be the output of the expression true + true in PHP?

Q. What is the purpose of the PHP function header()?

Q. Which PHP function returns the directory name of a given path?

Q. Which of these is not a valid PHP variable name?

Q. How do you retrieve the value of a POST variable named 'username'?

Q. What is the purpose of the PHP function implode()?

Q. Which of these is a correct way to comment in PHP?

Q. Which function checks if a file is writable?

Q. What is the output of the expression 5 + '10 little pigs'?

Q. Which function is used to redirect users to a different URL in PHP?

Q. What does the function json_encode() do?

Q. Which function is used to generate a random integer between two values?

Q. How do you declare a constant in PHP using the const keyword?

Q. Which function is used to get the length of an array in PHP?

Q. Which of the following keywords is used to catch exceptions?

Q. Which statement is true about PHP arrays?

Q. Which function is used to check if a file is writable?

Q. Which of the following variables is a global variable in PHP?

Q. What will the function header('Location: example.com'); do?

Q. How can you get the length of an array in PHP?

Q. Which PHP function converts a JSON string into a PHP variable?

Q. Which function can be used to check if a key exists in an array?

Q. Which PHP function is used to serialize a variable?

Q. Which of the following is the correct way to declare an associative array?

Q. What is the output of isset($var) if $var is null?

Q. Which function is used to close an open file in PHP?

Q. Which of the following is the correct way to open a file for writing in PHP?

Q. Which PHP function is used to check if a variable is an array?

Q. What is the output of print_r([1, 2, 3], true);?

Q. Which function in PHP returns the last error that occurred?

Q. What is the difference between include() and require() in PHP?

Q. Which function is used to include and evaluate a specified file during script execution?

Q. What is the output of var_dump(true && false);?

Q. Which function can be used to include code only once?

Q. What will print_r(array('a'=>1, 'b'=>2)); output?

Q. What is the use of the isset() function in PHP?

Q. Which function returns the current date and time?

Q. Which function is used to start a new PHP session?

Q. What does the PHP function htmlspecialchars() do?

Q. Which PHP function checks if a variable is numeric?

Q. What will be the output of echo 'Hello ' . 'World!'; ?

Q. Which keyword is used to declare a variable in PHP?

Q. What is the output of var_dump(null);?

Q. Which method is used to connect to a MySQL database using mysqli extension?

Q. Which function is used to remove whitespace from the beginning and end of a string?

Q. What will be the output of 5 > 3 ? 'Yes' : 'No'; ?

Q. Which operator is used for logical AND in PHP?

Q. Which of the following is used to define a constant in PHP?

Q. What is the output of echo 2 + '2 cars'; ?

Q. Which function returns the current Unix timestamp in PHP?

Q. How can you start a PHP script?

Q. Which function is used to convert a string to uppercase in PHP?

Q. Which function is used to get the type of a variable?

Q. Which of the following is a PHP error control operator?

Q. Which function is used to redirect to another page?

Q. Which of the following is the correct way to start a session?

Q. Which keyword is used to stop a loop in PHP?

Q. What will count([1,2,3]) return?

Q. Which magic method is used to return a string representation of an object?

Q. Which magic method is called when an object is created?

Q. What is the correct way to define a function in PHP?

Q. Which operator is used for concatenation in PHP?

Q. Which of the following is not a valid loop in PHP?

Q. Which function is used to sort an array in ascending order?

Q. What does the PHP function unlink() do?

Q. What will be the result of 4 === '4' in PHP?

Q. Which function is used to split a string into an array by a delimiter?

Q. What is the output of strlen('PHP')?

Q. Which superglobal is used to collect form data sent with the GET method?

Q. Which function ends a script in PHP?

Q. Which of the following is used to handle form submission in PHP?

Q. How are comments written in PHP?

Q. Which function is used to generate random numbers?

Q. Which function is used to convert a value to an integer in PHP?

Q. Which function is used to start output buffering?

Q. Which global variable contains information about headers, paths, and script locations?

Q. What does the === operator check?

Q. Which method is used to send email in PHP?

Q. Which function is used to include the contents of one PHP file into another?

Q. What is the use of continue in a loop?

Q. Which of the following is a loop construct in PHP?

Q. What does the require statement do?

Q. What is the output of echo 10 % 3?

Q. What does the PHP function empty() check?

Q. What is the use of the isset() function?

Q. Which function is used to check if a variable is set?

Q. Which of the following is used to handle errors in PHP?

Q. Which function is used to redirect a user to another page?

Q. What is the default file extension for PHP files?

Q. Which of the following is used to create a constant?

Q. What does the die() function do in PHP?

Q. Which PHP keyword is used to define a class?

Q. Which function is used to convert a string into an array?

Q. Which method is used to destroy a session in PHP?

Q. Which function is used to generate unique IDs in PHP?

Q. Which of the following is used to check whether a variable is an array?

Q. Which function is used to reverse an array?

Q. Which statement is used to include and evaluate a file only once?

Q. Which of these is a valid PHP opening tag?

Q. Which function returns an array of all the keys in an array?

Q. Which of the following is not a valid PHP data type?

Q. Which error type is not caught by a try-catch block?

Q. Which PHP function is used to open a file?

Q. Which function is used to hash a string using MD5?

Q. Which function is used to escape special characters in a string for use in an SQL statement?

Q. What is the result of the expression '5' + 5 in PHP?

Q. Which symbol is used to define a variable in PHP?

Q. Which function is used to get the current date and time in PHP?

Q. Which function removes the last element of an array?

Q. Which function can be used to merge two arrays?

Q. How do you check if a key exists in an array?

Q. Which of the following is a PHP magic constant?

Q. What does the '===' operator do in PHP?

Q. What is the result of 5 == '5' in PHP?

Q. Which function is used to include a file only once?

Q. How do you create an associative array in PHP?

Q. Which function can be used to sort an array in ascending order?

Q. Which of the following is a valid way to start a session?

Q. Which function checks if a file or directory exists?

Q. Which PHP function returns the type of a variable?

Q. Which statement is used to stop execution of a loop?

Q. Which function is used to convert a string to lowercase in PHP?

Q. What is the output of count([1, 2, 3])?

Q. Which superglobal is used to collect form data sent with POST method?

Q. Which operator is used for string concatenation in PHP?

Q. What will the expression true && false return?

Q. Which function deletes a file in PHP?

Q. Which function is used to read a file into a string in PHP?

Q. How do you declare a namespace in PHP?

Q. Which function is used to check if a file exists?

Q. How can you send data to a PHP script via a form?

Q. What does the explode() function do?

Q. Which loop will always execute at least once?

Q. Which superglobal holds information about server and execution environment?

Q. Which magic method is called automatically when an object is created?

Q. Which keyword is used to inherit a class in PHP?

Q. What will the expression 10 % 3 return in PHP?

Q. How do you access a cookie in PHP?

Q. Which function is used to redirect a page in PHP?

Q. What is the default file extension of PHP files?

Q. How can you create a constant in PHP?

Q. Which operator is used for comparison in PHP?

Q. Which function is used to terminate script execution in PHP?

Q. What does isset() function do?

Q. Which method is used to start a session in PHP?

Q. Which function is used to output text in PHP?

Q. Which of the following is used to declare a class in PHP?

Q. Which global array holds information about GET variables?

Q. Which PHP function is used to include the contents of one PHP file into another?

Q. Which function is used to count the number of elements in an array?

Q. Which of these is a correct way to declare an array in PHP?

Q. What will echo "Hello" . " World!"; output?

Q. How do you write a single-line comment in PHP?

Q. Which symbol is used to denote a variable in PHP?

Q. Which of the following is the correct way to start a PHP block?

Q. Which keyword is used to handle exceptions in PHP

Q. Which PHP function is used to read a file line by line

Q. What is the output of true and false in PHP

Q. Which PHP function returns an array of all keys from another array

Q. Which of these is a looping structure in PHP

Q. Which keyword is used to declare a constant using object oriented style

Q. Which magic method is used to create a string representation of an object

Q. Which function is used to check if a key exists in an array

Q. Which keyword is used to define an interface in PHP

Q. What is the purpose of the break statement in PHP

Q. Which PHP function can be used to replace text in a string

Q. What is the result of the expression five plus five dot zero in PHP

Q. What will happen if require fails to include a file

Q. Which function is used to convert an array into a string

Q. What is the use of unset function in PHP

Q. Which operator is used for strict comparison in PHP

Q. Which of these is a server side scripting language

Q. Which PHP function is used to get the type of a variable

Q. What is the default file extension for PHP files

Q. Which PHP keyword is used to inherit a class

Q. Which PHP function converts characters to HTML entities

Q. What does the die function do in PHP

Q. Which super global contains file upload information

Q. Which function is used to convert string to integer in PHP

Q. Which loop is used when the number of iterations is unknown

Q. Which PHP function is used to get the current timestamp

Q. Which operator is used to suppress errors in PHP

Q. Which function is used to sort arrays in ascending order in PHP

Q. What will be the output of empty function on zero

Q. Which function is used to destroy a session in PHP

Q. Which keyword is used to create a class in PHP

Q. What will the expression five equal equal five return in PHP

Q. Which method is used to redirect a page in PHP

Q. What will be the output of is numeric function if value is one two three

Q. Which function is used to send emails in PHP

Q. Which PHP function is used to count elements in an array

Q. What will the expression ten modulus three return in PHP

Q. Which of the following is a valid PHP variable name

Q. Which operator is used for equality comparison in PHP?

Q. Which PHP function is used to include a file only once?

Q. What is the default value of a variable in PHP if not initialized?

Q. What does the explode function do in PHP?

Q. How do you comment multiple lines in PHP?

Q. Which function is used to get the length of a string in PHP?

Q. Which of these is used to terminate a statement in PHP?

Q. What is the output of the expression 10 divided by 3 in PHP?

Q. How do you declare a constant in PHP?

Q. Which function is used to start a session in PHP?

Q. How can you concatenate two strings in PHP?

Q. What does the function isset do in PHP?

Q. Which super global array holds data sent via POST method?

Q. Which of the following is the correct way to start a PHP script?

Q. What will be the output of echo 5 plus 10 semicolon in PHP?

Q. Which function is used to include a file in PHP and stop the script if the file is not found?

Q. How do you write a single line comment in PHP?

Q. Which symbol is used to declare a variable in PHP?

Q. What does PHP stand for?

Q. How do you check the class of an object in Ruby?

Q. Which method converts a symbol to a string in Ruby?

Q. What is the result of 10 / 3 in Ruby?

Q. Which of these is the correct way to define a symbol-to-string hash key?

Q. What does the 'each' method do in Ruby?

Q. Which method is used to check if an array includes a specific element?

Q. What is the output of 'nil.nil?' in Ruby?

Q. How do you define a constant in Ruby?

Q. Which method converts a string to uppercase in Ruby?

Q. Which keyword is used to exit a loop in Ruby?

Q. Which keyword is used to raise an exception in Ruby?

Q. Which method returns the first element of an array in Ruby?

Q. Which method executes a block passed to a method in Ruby?

Q. How do you define a symbol in Ruby?

Q. Which method returns all the keys from a hash in Ruby?

Q. Class variables in Ruby start with which symbol?

Q. Instance variables in Ruby start with which symbol?

Q. What syntax is used for string interpolation in Ruby?

Q. Which method removes the last element from an array in Ruby?

Q. Which keyword is used to pass a block in Ruby?

Q. Which method is used to get the length of a string in Ruby?

Q. Which of the following is a valid way to start a Ruby program?

Q. How do you add an element to the end of an array in Ruby?

Q. What does the 'self' keyword represent in Ruby?

Q. How do you rescue an exception in Ruby?

Q. What does the 'attr_accessor' method do in Ruby?

Q. Which of the following is a Ruby symbol?

Q. How do you write an if-else statement in Ruby?

Q. Which operator is used for string concatenation in Ruby?

Q. Which method is used to convert a string to integer in Ruby?

Q. What is the output of '5.times { |i| puts i }'?

Q. How do you create a hash (dictionary) in Ruby?

Q. Which symbol is used to denote a comment in Ruby?

Q. What will 'puts' method do in Ruby?

Q. Which keyword is used to create a class in Ruby?

Q. How can you create an array in Ruby?

Q. How do you define a function (method) in Ruby?

Q. Which method is used to print output in Ruby?

Q. What is the file extension for Ruby files?