1.
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
cout << "To jest moj pierwszy program";
getchar();
return 0;
}
Program wyświetli?
Correct Answer
A. Napis z warunku "cout"
Explanation
The correct answer is "napis z warunku 'cout'". This is because the line "cout << "To jest moj pierwszy program";" is responsible for displaying the text "To jest moj pierwszy program" on the console.
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?
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.
3.
Instrukcja warunkowa to inaczej?
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.
4.
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?
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.
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?
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.
7.
Begin
writeln('Hello World');
end. Program napisany jest w języku?
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.
8.
Zmienna "short" ma zakres ?
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.
9.
Jaki znakie graficzny stosuje sie w jezyku c++ by ukazac negacje?
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".
10.
Ile bajtów ma zmienna "int" ?
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.