1.
Dalam aritmatika dijumpai istilah operator. Pengertian dari operator adalah...
Correct Answer
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.
2.
Operator dalam bahasa pemrograman dibedakan menjadi 3 bentuk, yaitu...
Correct Answer
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.
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...
Correct Answer
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.
4.
Operator AND akan mendapat nilai true apabila...
Correct Answer
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.
5.
Operator OR akan bernilai 0(false) apabila...
Correct Answer
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).
6.
Array merupakan struktur yang dapat di akses secara acak, karena...
Correct Answer
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.
7.
Untuk mendeklarasikan sebuah array dalam bahasa C harus menggunakan tanda...
Correct Answer
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.
8.
Array dua dimens memiliki 2 subskrip yaitu...
Correct Answer
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.
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...
Correct Answer
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.
10.
Apabila diketahui deklarasi sebuah array sebagai berikut :int posisi[3][5];Bagian dari deklarasi di atas yang disebut dengan jumlah elemen baris adalah...
Correct Answer
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.
11.
Tipe data dasar dalam pemrograman yang digunakan untuk menyatakan kumpulan karakter/kata/kalimat disebut...
Correct Answer
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.
12.
Untuk menggunakan tipe data string digunakan fungsi....dalam header pemrograman bahasa C.
Correct Answer
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.
13.
Fungsi strchr digunakan untuk mencari suatu nilai karakter yang berada dalam suatu nilai string. Bentuk penulisan dari fungsi ini adalah....
Correct Answer
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'.
14.
Membandingkan dua buah nilai string tidak dapat digunakan dengan operator hubungan, melainkan dengan menggunakan fungsi...
Correct Answer
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.
15.
Pointer merupakan sebuah variabel yang dapat menyimpan alamat memori. Format untuk mendeklarasika pointer adalah...
Correct Answer
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.
16.
Pendeklarasian sebuah pointer dengan menambahkan tanda...
Correct Answer
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.
17.
Tipe data dalam pointer void antara lain...
Correct Answer
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.
18.
Apabila mendeklarasikan pointer ke array artinya...
Correct Answer
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.
19.
Istilah lain dari pointer ke pointer adalah...
Correct Answer
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.
20.
Tentukan manakah nama-nama variabel berikut ini yang benar !
Correct Answer
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.