QBasic - 5. Razred

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Nina121
N
Nina121
Community Contributor
Quizzes Created: 1 | Total Attempts: 3,295
| Attempts: 3,295 | Pitanja: 20
Please wait...
Osnove programskog jezika QBASICOdaberite tocan ispis pojedinih dijelova koda programa.
Question 1 / 20
0 %
0/100
Score 0/100
1. Print "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.

Submit
Please wait...
About This Quiz
QBasic - 5. Razred - Quiz

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. Clsprint "sunce"

Explanation

The given code will print the word "sunce" and then clear the screen. Therefore, no additional text will be printed after "sunce".

Submit
3. Print marko

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.

Submit
4. Print "sunce"cls

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.

Submit
5. Clsprint "more"cls print "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.

Submit
6. A = 1b = 2print a + b

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.

Submit
7. A = 6b = 3print a;print b;print a / b

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.

Submit
8. A = 5print a

Explanation

The code assigns the value 5 to the variable 'a' and then prints the value of 'a', which is 5.

Submit
9. Print "marko""iva"

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.

Submit
10. Print "marko";print "iva"

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.

Submit
11. Print "marko";"iva"

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".

Submit
12. A = 5print "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'.

Submit
13. Print "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

Submit
14. A = 5print "a = ";a

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".

Submit
15. A = 1b = 2c = a + bprint a; "+"; b; "="; c

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".

Submit
16. A = 2b = 2c = 1d = a * b - cprint "a * b - c = "; d

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.

Submit
17. A = 2b = 2c = 1d = a * b - cprint c

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.

Submit
18. A = 1b = 2c = a + bprint zbroj

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.

Submit
19. A = 5b = 2print a \ b

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.

Submit
20. A = 5b = 2c = a mod bprint c

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.

Submit
View My Results

Quiz Review Timeline (Updated): Jul 22, 2024 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jul 22, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 30, 2010
    Quiz Created by
    Nina121
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Print "marko"
Clsprint "sunce"
Print marko
Print "sunce"cls
Clsprint "more"cls print "nebo"
A = 1b = 2print a + b
A = 6b = 3print a;print b;print a / b
A = 5print a
Print "marko""iva"
Print "marko";print "iva"
Print "marko";"iva"
A = 5print "a"
Print "marko";" iva"
A = 5print "a = ";a
A = 1b = 2c = a + bprint a; "+"; b; "="; c
A = 2b = 2c = 1d = a * b - cprint "a * b - c = "; d
A = 2b = 2c = 1d = a * b - cprint c
A = 1b = 2c = a + bprint zbroj
A = 5b = 2print a \ b
A = 5b = 2c = a mod bprint c
Alert!

Advertisement