2.2 Analizowac Programy I Algorytmy

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 Szymek2231
S
Szymek2231
Community Contributor
Quizzes Created: 1 | Total Attempts: 131
Questions: 10 | Attempts: 131

SettingsSettingsSettings
2.2 Analizowac Programy I Algorytmy - Quiz

Quiz 2.2


Questions and Answers
  • 1. 

    #include <iostream> #include <cstdio> using namespace std; int main() { cout << "To jest moj pierwszy program"; getchar(); return 0; }                                                                                                                 Program wyświetli?

    • A.

      Napis z warunku "cout"

    • B.

      Program nic nie wyświetli

    • C.

      Wyswietli 0

    • D.

      Wyswietli napis "cout"

    Correct Answer
    A. Napis z warunku "cout"
    Explanation
    The correct answer is "napis z warunku 'cout'". This is because the line "cout

    Rate this question:

  • 2. 

    #include <iostream> #include <cstdio> using namespace std; int main() {         int liczba; // deklaracja zmiennej cout << "Podaj liczbe "; cin >> liczba; // przypisanie wartości z klawiatury if (liczba>0) // instrukcja warunkowa cout << "Liczba jest dodatnia"; else cout << "Liczba nie jest dodatnia"; cin.ignore(); getchar(); return 0; }                                                                                                   program zawiera instrukcje?

    • A.

      Wyboru

    • B.

      Warunkową

    • C.

      Iteracyjną

    • D.

      Sortowania

    Correct Answer
    B. Warunkową
    Explanation
    The given program contains an if-else statement, which is a conditional statement used for decision making. It checks if the value of the variable "liczba" is greater than 0. If it is, the program prints "Liczba jest dodatnia" (The number is positive). Otherwise, it prints "Liczba nie jest dodatnia" (The number is not positive). This indicates that the program includes a conditional (or selection) statement.

    Rate this question:

  • 3. 

    Instrukcja warunkowa to inaczej?

    • A.

      While...

    • B.

      For...

    • C.

      If...else

    • D.

      Do...

    Correct Answer
    C. If...else
    Explanation
    The correct answer is "if...else" because an "if...else" statement is a conditional statement that allows a program to make decisions based on certain conditions. It checks if a condition is true, and if it is, it executes a certain block of code. If the condition is false, it executes a different block of code. This statement is commonly used when there are two possible outcomes or actions based on a condition.

    Rate this question:

  • 4. 

    • A.

      X=0; while (x

    • B.

      X=0; do {x++;} while (x>10)

    • C.

      X=0; do {x=x+1;} while (x

    • D.

      For (x=0;x

    Correct Answer
    A. X=0; while (x
  • 5. 

    #include <iostream> int main() { int ile = 4; do {                   std::cout << "Napis" << std::endl; ile--; } while( ile > 0 ); return 0; }                                                                                                   Jaka pętla została tu użyta?

    • A.

      To be...or not to be

    • B.

      For...

    • C.

      If...else

    • D.

      Do...while

    Correct Answer
    D. Do...while
    Explanation
    The correct answer is "do...while" because the code uses the do-while loop structure. In this loop, the code block is executed at least once before the condition is checked. In this case, the code block prints the string "Napis" and decreases the value of the variable "ile" by 1. The loop continues until "ile" is greater than 0.

    Rate this question:

  • 6. 

    #include <iostream> #include <cstdio> using namespace std; int main() {                for (int i=0; i<20; i++) { cout << i; if (i%3!=0) // jeśli reszta z dzielenia przez 3 jest różna od zera cout << " - nie jest podzielne przez 3, "; cout << endl; } getchar(); return 0; }                                                                                program wyświetli?

    • A.

      Liczby parzyste od 1 do 20

    • B.

      Liczby od 1 do 20

    • C.

      Liczby nieparzyste od 1 do 20

    • D.

      Liczby od 0 do 19

    Correct Answer
    B. Liczby od 1 do 20
    Explanation
    The program will display numbers from 1 to 20. The for loop iterates from 0 to 19, and at each iteration, the value of i is printed. If i is not divisible by 3, a message indicating that it is not divisible by 3 is also printed. Since the loop starts from 0 and ends at 19, the numbers displayed will be from 1 to 20.

    Rate this question:

  • 7. 

    Begin writeln('Hello World'); end.                                                           Program napisany jest w języku?

    • A.

      Java

    • B.

      C++

    • C.

      Pascal

    • D.

      C--

    Correct Answer
    C. Pascal
    Explanation
    The given program is written in the Pascal programming language. This can be determined by looking at the syntax used in the program, which is typical of Pascal. The program starts with the keyword "begin" and ends with the keyword "end.", which are both used in Pascal to mark the beginning and end of a program. Additionally, the "writeln" statement is also commonly used in Pascal to output text to the console.

    Rate this question:

  • 8. 

    Zmienna "short" ma zakres ?

    • A.

      Od -32 768 do 32 767

    • B.

      Od -128 do 127

    • C.

      True/false

    • D.

      od -32 767 do 32 768

    Correct Answer
    A. Od -32 768 do 32 767
    Explanation
    The correct answer is "od -32 768 do 32 767". This is because a "short" variable in programming typically has a range from -32,768 to 32,767.

    Rate this question:

  • 9. 

    Jaki znakie graficzny stosuje sie w jezyku c++ by ukazac negacje?

    • A.

      ?

    • B.

      &&

    • C.

      $

    • D.

      !

    Correct Answer
    D. !
    Explanation
    The correct answer is "!". In the C++ language, the exclamation mark is used to represent the negation operator. It is commonly used in conditional statements and logical expressions to reverse the value of a boolean variable or expression. For example, "if (!condition)" means "if the condition is false".

    Rate this question:

  • 10. 

    Ile bajtów ma zmienna "int" ?

    • A.

      4 bajty

    • B.

      2 bajty

    • C.

      8 bajtów

    • D.

      1 bajt

    Correct Answer
    A. 4 bajty
    Explanation
    The correct answer is 4 bytes. In most programming languages, the "int" data type typically occupies 4 bytes of memory. This allows it to store a range of values from -2,147,483,648 to 2,147,483,647.

    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 18, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 28, 2012
    Quiz Created by
    Szymek2231
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.