wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Golang,PHP,Ruby,C#

Total questions: 40

Worksheet time: 26mins

Name
Class
Date
1.

What does PHP stand for?

a)

Preprocessor Hypertext Page

b)

Personal Home Page

c)

Hypertext Transfer Protocol

d)

PHP Hypertext Preprocessor

2.

PHP is considered a server-side scripting language.

a)

True

b)

False

c)

Maybe

d)

I don't know

3.

Which of the following extension is correct for PHP files?

a)

.html

b)

.opp

c)

.php

d)

.pxp

4.

How do you start the PHP scripting block?

a)

<php.....?>

b)

<script .... script>

c)

<?php.... ?php>

d)

<?......?php>

5.

Variables in PHP always begins with...

a)

?

b)

&

c)

$

d)

#

6.

Which of the following is the correct syntax to start a multiple line comment in PHP?

a)

#-----------#

b)

/______/

c)

/*--------*/

d)

/------/*

7.

$i = 1;

while ($i < 6) {

echo $i;

(a)  

}

8.

$txt = "W3Schools.com";

echo "I love (a)   !";

9.

$t = date("H");

if ($t < "10") {

echo "Have a good morning!";

} elseif ($t < "20") {

(a)   "Have a good day!";

} else {

echo "Have a good night!";

}

10.

$x = 5985;

var_dump( (a)   ($x));

11.

_________ is an interpreted, high-level, general-purpose programming language which supports multiple programming paradigms.

a)

Ruby Language

b)

Java Language

c)

Html

d)

R Language

12.

In Ruby a ______ refers to a value of either true or false

a)

Array

b)

Boolean

c)

Numbers

d)

Loop

13.

Ruby language founder?

Two words.

(a)  

14.

In ruby,
a = 19

b = 4

(a)     a + b

15.

Extension that will run Ruby Language

a)

.rv

b)

.r

c)

.com

d)

.rb

16.

Ruby ____ is a collection of key-value pairs.

a)

Numbers

b)

Hash

c)

Loop

d)

Boolean

17.

Write the command to get installed Ruby version in your system.



(a)  

18.

Ruby program to illustrate 'while' loop

x = 4

while x >= 1

x = x - 1

(a)  

19.

Ruby _____are ordered, integer-indexed collections of any object.

a)

Hash

b)

Numbers

c)

Arrays

d)

Loop

20.

A _______ object in Ruby holds and manipulates an arbitrary sequence of one or more bytes, typically representing characters that represent human language

a)

String

b)

Boolean

c)

Array

d)

Hash

21.

What is a correct syntax to output "Hello World" in C#?

a)
b)
c)
d)
22.

C# is an alias of C++

a)

True

b)

False

23.

The most common method to output something in C# is ....................

a)

WriteLine()

b)

Print

c)

cout

d)

cin

24.

How do you insert COMMENTS in C# code?

a)

# This is a comment

b)

// this a comment

c)

/* This ia a comment

25.

The types of Variables who stores floating point numbers is ..............

a)

int

b)

char

c)

double

d)

bool

26.

Which data type is used to create a variable that should store text?

a)

String

b)

Int

c)

Double

d)

Char

27.

How do you create a variable with the numeric value 5?

a)

num x = 5;

b)

int x = 5;

c)

x = 5;

d)

double x = 5;

28.

How do you create a variable with the floating number 2.8?

a)

int x = 2.8;

b)

int x = 2.8D;

c)

byte x = 2.8;

d)

double x = 2.8D;

29.

The character must be surrounded by ......................

a)

single quotes

b)

Double quotes

c)

Angle brackets

d)

Square brackets

30.

public class Program{

public static int addition(int a, int b){

return (a+b);

}

public static void Main(){

int a,b;

int sum;

Console.Write("Enter first number: ");

a = ____________(Console.ReadLine());

Console.Write("Enter second number: ");

b = ____________(Console.ReadLine());

sum = addition(a,b);

Console.WriteLine("Sum is: " + sum);

}

(a)  

31.

Golang was developed at

a)

Microsoft

b)

Google

32.

Golang is an Open-source programming language

a)

Yes

b)

No

c)

Maybe

33.

In which year GOlang named as "Lang of the year"

a)

2019

b)

2016

c)

2017

d)

2018

34.

Time duration for converting programming code into Machine code is

a)

Compile Time

b)

Run Time

35.

import "fmt"

func main() {

var number1, number2, number3 int

number1 = 99

number2 = 81

number3 = number1 + number2

fmt. (a)   ("The addition of ", number1, " and ", number2, " is \n ", number3, "\n(Addition of two integers within the function)")

}

36.

import "fmt"

func addNumber(number1, number2 int) int {

return number1 + number2

}

func main() {

var number1, number2, number3 int

number1 = 18

number2 = 9

number3 = (a)   (number1, number2)

// printing the results

fmt.Println("The addition of ", number1, " and ", number2, " is \n", number3, "\n(adding two integers outside the function)")

}

37.

Created by Robert Griesemer, Rob Pike, and (a)   , Go (also known as Golang) is an open-source language that first began development in 2007.

38.

import ("fmt")

func main() {
  myslice1 := []int{}
  fmt.Println(len( (a)   ))


}

39.

what is the variable for Go Constant.

(a)  

40.

import ("fmt")

func main() {
   (a)   arr1 = [3]int{1,2,3}
  arr2 := [5]int{4,5,6,7,8}

  fmt.Println(arr1)
  fmt.Println(arr2)
}