QBasic - 5. Razred

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Nina121
N
Nina121
Community Contributor
Quizzes Created: 1 | Total Attempts: 3,295
Pitanja: 20 | Attempts: 3,295

SettingsSettingsSettings
QBasic - 5. Razred - Quiz

Osnove programskog jezika QBASICOdaberite tocan ispis pojedinih dijelova koda programa.


Questions and Answers
  • 1. 

    Print marko

    • A.

      Marko

    • B.

      Print marko

    • C.

      Program ce ispisati nulu. Doslo je do greske.

    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.

    Rate this question:

  • 2. 

    Print "marko"

    • A.

      Marko

    • B.

      Print marko

    • C.

      Program ce ispisati nulu. Doslo je do greske.

    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.

    Rate this question:

  • 3. 

    Print "marko""iva"

    • A.

      Marko iva

    • B.

      Markoiva

    • C.

      Program ce javiti gresku.

    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.

    Rate this question:

  • 4. 

    Print "marko";"iva"

    • A.

      Marko iva

    • B.

      Markoiva

    • C.

      Program ce javiti gresku.

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

    Rate this question:

  • 5. 

    Print "marko";" iva"

    • A.

      Marko iva

    • B.

      Markoiva

    • C.

      Program ce javiti gresku.

    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

    Rate this question:

  • 6. 

    Print "marko";print "iva"

    • A.

      Marko iva

    • B.

      Markoiva

    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.

    Rate this question:

  • 7. 

    Print "sunce"cls

    • A.

      Cls

    • B.

      Sunce

    • C.

      Nece pisati nista.

    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.

    Rate this question:

  • 8. 

    Clsprint "sunce"

    • A.

      Sunce

    • B.

      Cls

    • C.

      Nece pisati nista.

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

    Rate this question:

  • 9. 

    Clsprint "more"cls print "nebo"

    • A.

      More

    • B.

      Morenebo

    • C.

      Nebo

    • D.

      Nece pisati nista.

    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.

    Rate this question:

  • 10. 

    A = 5print "a"

    • A.

      5

    • B.

      A

    • C.

      A = 5

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

    Rate this question:

  • 11. 

    A = 5print a

    • A.

      5

    • B.

      A

    • C.

      A = 5

    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.

    Rate this question:

  • 12. 

    A = 5print "a = ";a

    • A.

      A = 5

    • B.

      A = a

    • C.

      Program ce javiti gresku.

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

    Rate this question:

  • 13. 

    A = 1b = 2c = a + bprint zbroj

    • A.

      3

    • B.

      A + b

    • C.

      Zbroj

    • D.

      Program ce ispisati nulu. Doslo je do greske.

    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.

    Rate this question:

  • 14. 

    A = 1b = 2print a + b

    • A.

      A + b

    • B.

      3

    • C.

      Program ce ispisati nulu. Doslo je do greske.

    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.

    Rate this question:

  • 15. 

    A = 1b = 2c = a + bprint a; "+"; b; "="; c

    • A.

      A + b = c

    • B.

      A + b = 3

    • C.

      1 + 2 = 3

    • D.

      Program ce javiti gresku.

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

    Rate this question:

  • 16. 

    A = 2b = 2c = 1d = a * b - cprint c

    • A.

      1

    • B.

      2

    • C.

      3

    • D.

      5

    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.

    Rate this question:

  • 17. 

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

    • A.

      4

    • B.

      1

    • C.

      2 * 2 - 1 = 3

    • D.

      A * b - c = 3

    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.

    Rate this question:

  • 18. 

    A = 6b = 3print a;print b;print a / b

    • A.

      Aba / b

    • B.

      632

    • C.

      A / b = 2

    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.

    Rate this question:

  • 19. 

    A = 5b = 2print a \ b

    • A.

      2.5

    • B.

      3

    • C.

      2

    • D.

      Program ce javiti gresku.

    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.

    Rate this question:

  • 20. 

    A = 5b = 2c = a mod bprint c

    • A.

      1

    • B.

      A mod b

    • C.

      C

    • D.

      Program ce javiti gresku.

    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.

    Rate this question:

Quiz Review Timeline +

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

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 30, 2010
    Quiz Created by
    Nina121
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.