# Pemrograman Dasar Xi Tkj

Approved & Edited by ProProfs Editorial Team
At ProProfs Quizzes, our dedicated in-house team of experts takes pride in their work. With a sharp eye for detail, they meticulously review each quiz. This ensures that every quiz, taken by over 100 million users, meets our standards of accuracy, clarity, and engagement.
| Written by Warsikowarsiko
W
Warsikowarsiko
Community Contributor
Quizzes Created: 1 | Total Attempts: 360
Questions: 20 | Attempts: 360

Settings

.

• 1.

### Dalam aritmatika dijumpai istilah operator. Pengertian dari operator adalah...

• A.

Variabel yang terdapat dalam ekspresi matematika

• B.

Urutan operasi yang menentukan operasi aritmatika

• C.

Simbol yang digunakan untuk menyusun suatu ekspresi

• D.

Jumlah operand yang terdapat dalam ekspresi aritmatika

• E.

Gabungan dari beberapa variabel yang membentuk ekspresi aritmatika

• F.

Gabungan dari beberapa variabel yang membentuk ekspresi aritmatika

C. Simbol yang digunakan untuk menyusun suatu ekspresi
Explanation
The correct answer is "Simbol yang digunakan untuk menyusun suatu ekspresi". In arithmetic, an operator refers to symbols that are used to compose or construct an expression. Operators are used to perform various mathematical operations such as addition, subtraction, multiplication, and division. They are essential in forming and manipulating mathematical expressions.

Rate this question:

• 2.

### Operator dalam bahasa pemrograman dibedakan menjadi 3 bentuk, yaitu...

• A.

Unary, binary, dan ternary

• B.

Aritmatika, logika dan assignment

• C.

Bitwise, relasional, dan logika

• D.

Aritmatika, relasional, dan assignment

• E.

Binary, logika, dan relasional

A. Unary, binary, dan ternary
Explanation
The correct answer is "unary, binary, dan ternary". In programming languages, operators are categorized into three forms: unary, binary, and ternary. Unary operators operate on a single operand, while binary operators operate on two operands, and ternary operators operate on three operands. This categorization helps in understanding and using operators effectively in programming.

Rate this question:

• 3.

### Perhatikan pernyataan berikut :1) Operasi logika2) Operasi penjumlahan3) Operasi NOT4) Operasi pengurangan5) Operasi perkalian6) Operasi OR7) Operasi pembagian8) Operasi relasional9) Operasi prosentaseDari pernyataan di atas yang termasuk operasi dasar aritmatika adalah...

• A.

1,2,4,6,7

• B.

2,3,7,8,9

• C.

2,5,7,8,9

• D.

2,4,5,7,9

• E.

3,5,6,7,8

D. 2,4,5,7,9
Explanation
The correct answer is 2,4,5,7,9 because these options include the basic arithmetic operations such as addition (2), subtraction (4), multiplication (5), division (7), and percentage (9). The other options do not include all of these basic arithmetic operations.

Rate this question:

• 4.

### Operator AND akan mendapat nilai true apabila...

• A.

Operand A bernilai 0 dan operand B bernilai 1

• B.

Operand A bernilai 1 dan operand B bernilai 0

• C.

Operand A bernilai 0 dan operand B bernilai 0

• D.

Operand A bernilai 1 dan operand B bernilai 1

• E.

Semua jawaban salah

D. Operand A bernilai 1 dan operand B bernilai 1
Explanation
The correct answer is "operand A bernilai 1 dan operand B bernilai 1" because the AND operator returns true only when both operands are true. In this case, when operand A is 1 and operand B is 1, both operands are true and hence the AND operator will evaluate to true.

Rate this question:

• 5.

### Operator OR akan bernilai 0(false) apabila...

• A.

Operand A bernilai 0 dan operand B bernilai 1

• B.

Operand A bernilai 0 dan operand B bernilai 0

• C.

Operand A bernilai 1 dan operand B bernilai 0

• D.

Operand A bernilai 1 dan operand B bernilai 1

• E.

Semua jawaban salah

B. Operand A bernilai 0 dan operand B bernilai 0
Explanation
The correct answer is "operand A bernilai 0 dan operand B bernilai 0." This is because the OR operator will only evaluate to true (1) if at least one of the operands is true. In this case, if operand A is 0 and operand B is also 0, both operands are false and the OR operator will evaluate to false (0).

Rate this question:

• 6.

### Array merupakan struktur yang dapat di akses secara acak, karena...

• A.

Mempunyai tipe data yang sama

• B.

Semua elemen array dapat di acu secara acak dengan aturan tertentu

• C.

Terdiri dari satu atau lebih subskrip

• D.

Memiliki beberapa elemen array

• E.

Terdiri dari elemen-elemen homogen

B. Semua elemen array dapat di acu secara acak dengan aturan tertentu
Explanation
The correct answer is "semua elemen array dapat di akses secara acak dengan aturan tertentu" which means "all array elements can be randomly accessed with certain rules". This is because arrays allow direct access to any element in the array using its index. The index serves as the "rule" or reference to access the elements in the array. Therefore, arrays provide random access to its elements based on the specified index.

Rate this question:

• 7.

### Untuk mendeklarasikan sebuah array dalam bahasa C harus menggunakan tanda...

• A.

(...)

• B.

{...}

• C.

• D.

[...]

• E.

"..."

B. {...}
Explanation
The correct answer is "{...}". In C language, to declare an array, we use curly braces "{ }" to enclose the elements of the array. The elements are separated by commas. Therefore, the correct way to declare an array in C is by using "{ }" to enclose the elements of the array.

Rate this question:

• 8.

### Array dua dimens memiliki 2 subskrip yaitu...

• A.

String

• B.

Konstanta

• C.

Huruf dan angka

• D.

Pointer

• E.

Baris dan kolom

E. Baris dan kolom
Explanation
Array dua dimensi memiliki 2 subskrip yaitu baris dan kolom. Dalam array dua dimensi, data disusun dalam bentuk tabel dengan baris dan kolom. Subskrip baris digunakan untuk mengakses baris tertentu dalam array, sedangkan subskrip kolom digunakan untuk mengakses elemen dalam baris tersebut. Dengan menggunakan subskrip baris dan kolom, kita dapat mengidentifikasi dan mengakses elemen yang tepat dalam array dua dimensi.

Rate this question:

• 9.

### Apabila kita ingin mengambil nilai suatu array yang terdapat pada elemen ke-7 dan menampung elemen tersebut kedalam sebuah variabel yang bertipe int (misal Y), maka kode yang kita tulis adalah...

• A.

LARIK[7]=Y;

• B.

Y=LARIK[6];

• C.

Y[5]=LARIK;

• D.

LARIK[Y]=6;

• E.

LARIK=Y[7];

B. Y=LARIK[6];
Explanation
The correct answer is "Y=LARIK[6];" because it assigns the value of the element at index 6 in the array LARIK to the variable Y.

Rate this question:

• 10.

### Apabila diketahui deklarasi sebuah array sebagai berikut :int posisi[3][5];Bagian dari deklarasi di atas yang disebut dengan jumlah elemen baris adalah...

• A.

Int posisi

• B.

Int

• C.

Posisi

• D.

[3]

• E.

[5]

D. [3]
Explanation
The part of the declaration that is referred to as the number of row elements is [3]. This means that the array "posisi" has 3 rows.

Rate this question:

• 11.

### Tipe data dasar dalam pemrograman yang digunakan untuk menyatakan kumpulan karakter/kata/kalimat disebut...

• A.

Array

• B.

Pointer

• C.

Char

• D.

String

• E.

Integer

C. Char
Explanation
The correct answer is "Char" because char is the basic data type in programming used to represent a single character. It is used to store characters such as letters, digits, symbols, or whitespace. In contrast, an array is a collection of elements of the same data type, a pointer is a variable that stores the memory address of another variable, a string is a collection of characters, and an integer is a whole number without a fractional or decimal part.

Rate this question:

• 12.

### Untuk menggunakan tipe data string digunakan fungsi....dalam header pemrograman bahasa C.

• A.

Include

• B.

Include

• C.

Include

• D.

Include

• E.

Include

C. Include
Explanation
The correct answer is "include" because the question is asking for the function that is used to use the string data type in the C programming language. The "include" function is used to include header files in C, which contain the necessary functions and definitions for working with strings.

Rate this question:

• 13.

### Fungsi strchr digunakan untuk mencari suatu nilai karakter yang berada dalam suatu nilai string. Bentuk penulisan dari fungsi ini adalah....

• A.

Strchr(var_string, 'x')

• B.

Strchr('x' ,var_string)

• C.

Strchr(var_string)

• D.

Strchr(var_tujuan, 'x')

• E.

Strchr(var_asal, var_string)

A. Strchr(var_string, 'x')
Explanation
The correct answer is strchr(var_string, 'x'). This is because the strchr function is used to search for a specific character within a string. In this case, the variable var_string is the string in which we want to search for the character 'x'.

Rate this question:

• 14.

### Membandingkan dua buah nilai string tidak dapat digunakan dengan operator hubungan, melainkan dengan menggunakan fungsi...

• A.

Strupr()

• B.

Strlen()

• C.

Strlwr()

• D.

Strcmp()

• E.

Strtok()

D. Strcmp()
Explanation
The correct answer is strcmp(). This function is used to compare two string values. It returns 0 if the strings are equal, a negative value if the first string is less than the second string, and a positive value if the first string is greater than the second string. Therefore, strcmp() is the appropriate function to use when comparing two string values.

Rate this question:

• 15.

### Pointer merupakan sebuah variabel yang dapat menyimpan alamat memori. Format untuk mendeklarasika pointer adalah...

• A.

Tipe_data *nama_pointer;

• B.

Tipe data = *nama_pointer;

• C.

Char *pointer;

• D.

*nama_pointer=tipe data;

• E.

Tipe data(*nama_pointer);

A. Tipe_data *nama_pointer;
Explanation
The correct answer is "tipe_data *nama_pointer;". This is the correct format for declaring a pointer in C or C++. The asterisk (*) is used to indicate that the variable is a pointer, and it is placed before the variable name. In this format, "tipe_data" represents the data type that the pointer will point to, and "nama_pointer" is the name of the pointer variable.

Rate this question:

• 16.

### Pendeklarasian sebuah pointer dengan menambahkan tanda...

• A.

[....]

• B.

{....}

• C.

*

• D.

**

• E.

{....};

C. *
Explanation
The correct answer is the asterisk symbol (*). In C programming language, the asterisk symbol is used to declare a pointer variable. It is placed before the variable name to indicate that the variable is a pointer and will store the memory address of another variable.

Rate this question:

• 17.

### Tipe data dalam pointer void antara lain...

• A.

Character, integer, double

• B.

Integer, long integer, float

• C.

Boolean, integer, float

• D.

Integer, float, string

• E.

String, long integer, double

A. Character, integer, double
Explanation
The correct answer is character, integer, double. In C programming, a void pointer is a generic pointer type that can hold the address of any data type. It does not have a specific data type associated with it. Therefore, it can be used to point to data of any type, including character, integer, and double.

Rate this question:

• 18.

### Apabila mendeklarasikan pointer ke array artinya...

• A.

Menunjuk variabel array kemudian variabel pointer

• B.

Memerintahkan memproses variabel pointer kemudian ke array

• C.

Mendeklarasikan variabel pointer yang akan digunakan untuk menunjuk ke variabel yang bertipe array

• D.

Pointer menunjuk ke elemen pertama array

• E.

Semua jawaban salah

C. Mendeklarasikan variabel pointer yang akan digunakan untuk menunjuk ke variabel yang bertipe array
Explanation
The correct answer is "mendeklarasikan variabel pointer yang akan digunakan untuk menunjuk ke variabel yang bertipe array." This means that when declaring a pointer to an array, we are creating a variable that will be used to point to a variable of array type. In other words, the pointer variable will store the memory address of the first element of the array.

Rate this question:

• 19.

### Istilah lain dari pointer ke pointer adalah...

• A.

Multiple indirection

• B.

Multiciple indirection

• C.

Multigeneral indirection

• D.

Multiple indefinition

• E.

Multiple index

A. Multiple indirection
Explanation
The term "multiple indirection" refers to the concept of having a pointer that points to another pointer. In other words, it is a pointer that indirectly points to another pointer. This allows for a level of abstraction and flexibility in programming, as it allows for the manipulation and access of multiple levels of data structures.

Rate this question:

• 20.

### Tentukan manakah nama-nama variabel berikut ini yang benar !

• A.

Nama.guru

• B.

2x Buku

• C.

Harga buku

• D.

NamaGuru

• E.

Harga/buku

D. NamaGuru
Explanation
The variable "NamaGuru" is correct because it follows the naming conventions for variables. In programming, variable names should start with a letter or underscore, followed by any combination of letters, numbers, or underscores. The variable "NamaGuru" starts with a letter and does not contain any special characters or spaces, making it a valid variable name.

Rate this question:

×

Wait!
Here's an interesting quiz for you.