1.
Print marko
Correct Answer
C. Program ce ispisati nulu. Doslo je do greske.
Explanation
The given code is trying to print the value of a variable called "marko" twice. However, it seems that there is an error in the code which is causing the program to terminate with an error message. Therefore, the program will not be able to print the value of "marko" and will display the error message instead.
2.
Print "marko"
Correct Answer
A. Marko
Explanation
The given code snippet is trying to print the string "marko". However, there is a syntax error in the code. The correct way to print a string in Python is to enclose it within quotation marks. So, the correct code should be `print("marko")`. The error in the code caused it to print the variable `marko` instead, which is not defined and resulted in an error.
3.
Print "marko""iva"
Correct Answer
C. Program ce javiti gresku.
Explanation
The given code is trying to print the string "marko" and "iva" together without any separator. However, there is a syntax error in the code because there is an extra quotation mark after "marko". This will cause a syntax error and the program will throw an error message. Therefore, the correct answer is that the program will give an error.
4.
Print "marko";"iva"
Correct Answer
B. Markoiva
Explanation
The given code will print "markoiva" as the output. This is because the code uses the semicolon (;) to separate two strings "marko" and "iva". When these two strings are printed consecutively, they will be concatenated without any space between them, resulting in "markoiva".
5.
Print "marko";" iva"
Correct Answer
A. Marko iva
Explanation
The given code will print "marko" and "iva" on separate lines because the semicolon acts as a line terminator. So the output will be:
marko
iva
6.
Print "marko";print "iva"
Correct Answer
B. Markoiva
Explanation
The given code will print "marko" and "iva" on separate lines because the print statement is used twice with a semicolon separating them. The semicolon acts as a line terminator, causing each print statement to be executed separately. Therefore, "marko" will be printed on one line and "iva" will be printed on the next line.
7.
Print "sunce"cls
Correct Answer
C. Nece pisati nista.
Explanation
The given code is trying to print the word "sunce" and then clear the screen using the "cls" command. However, there is a syntax error in the code. The correct order of the commands should be "cls" followed by "print "sunce"". Since the code is written incorrectly, it will not print anything and the correct answer is "Nece pisati nista" which means "It will not write anything" in English.
8.
Clsprint "sunce"
Correct Answer
A. Sunce
Explanation
The given code will print the word "sunce" and then clear the screen. Therefore, no additional text will be printed after "sunce".
9.
Clsprint "more"cls print "nebo"
Correct Answer
C. Nebo
Explanation
The given code snippet is written in a programming language, possibly Python. The first line "clsprint "more"cls" seems to have a syntax error as "clsprint" is not a valid command. However, the second line "print "nebo"" is correct and will print the string "nebo" to the console. Therefore, the correct answer is "nebo" which is the output of the print statement.
10.
A = 5print "a"
Correct Answer
B. A
Explanation
The given code assigns the value 5 to the variable 'a' and then prints the value of 'a'. Therefore, the output of this code will be '5'.
11.
A = 5print a
Correct Answer
A. 5
Explanation
The code assigns the value 5 to the variable 'a' and then prints the value of 'a', which is 5.
12.
A = 5print "a = ";a
Correct Answer
A. A = 5
Explanation
The given code assigns the value 5 to the variable "a" and then prints the value of "a". Therefore, the output of the code will be "a = 5".
13.
A = 1b = 2c = a + bprint zbroj
Correct Answer
D. Program ce ispisati nulu. Doslo je do greske.
Explanation
The given code is attempting to print the value of the variable "zbroj", but there is no variable named "zbroj" in the code. Therefore, the program will encounter an error and will not be able to print anything.
14.
A = 1b = 2print a + b
Correct Answer
B. 3
Explanation
The given code assigns the value 1 to variable 'a' and the value 2 to variable 'b'. Then it prints the sum of 'a' and 'b', which is 3. Therefore, the correct answer is 3.
15.
A = 1b = 2c = a + bprint a; "+"; b; "="; c
Correct Answer
C. 1 + 2 = 3
Explanation
The given code assigns the value 1 to variable a, the value 2 to variable b, and calculates the sum of a and b and assigns it to variable c. The code then prints the values of a, "+", b, "=", and c. The correct answer is 1 + 2 = 3 because when the code is executed, the value of a is 1, the value of b is 2, and the sum of a and b is 3. Therefore, the output of the code will be "1 + 2 = 3".
16.
A = 2b = 2c = 1d = a * b - cprint c
Correct Answer
A. 1
Explanation
The correct answer is 1 because the value of c is determined by the equation d = a * b - c. Given that a = 2, b = 2, and d = 1, we can substitute these values into the equation to solve for c. Thus, 1 = 2 * 2 - c, which simplifies to 1 = 4 - c. By rearranging the equation, we get c = 4 - 1 = 3. Therefore, the value of c is 3.
17.
A = 2b = 2c = 1d = a * b - cprint "a * b - c = "; d
Correct Answer
D. A * b - c = 3
Explanation
The given code assigns the values 2, 2, 1, and the result of the expression 2 * 2 - 1 to variables a, b, c, and d respectively. The expression a * b - c is then printed, resulting in the value 3.
18.
A = 6b = 3print a;print b;print a / b
Correct Answer
B. 632
Explanation
The given code assigns the value 6 to variable a and the value 3 to variable b. Then, it prints the value of a, which is 6, followed by the value of b, which is 3. Finally, it calculates the result of a divided by b, which is 2, and prints it. Therefore, the correct answer is 632.
19.
A = 5b = 2print a \ b
Correct Answer
C. 2
Explanation
The given code calculates the result of dividing the value of variable 'a' (which is 5) by the value of variable 'b' (which is 2). The division operation in Python (/) returns a float value, so the result is 2.5.
20.
A = 5b = 2c = a mod bprint c
Correct Answer
A. 1
Explanation
The given code assigns the value 5 to variable a, the value 2 to variable b, and then calculates the modulus of a and b, storing the result in variable c. The modulus operator calculates the remainder when a is divided by b. In this case, 5 divided by 2 leaves a remainder of 1. Therefore, the value of c is 1.