Algoritma Dan Pemograman I

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Chermansyah
C
Chermansyah
Community Contributor
Quizzes Created: 1 | Total Attempts: 694
| Attempts: 694 | Pertanyaan: 45
Please wait...

Question 1 / 45
0 %
0/100
Score 0/100
1. Tipe data yang cocok untuk menampung nama mahasiswa adalah

Explanation

The correct answer is Char because a character data type is suitable for storing individual characters, such as letters or symbols, and can be used to represent a single character in a name. Int is used for storing whole numbers, Boolean is used for storing true/false values, Real is used for storing decimal numbers, and Byte is used for storing small numbers.

Submit
Please wait...
About This Quiz
Algoritma Dan Pemograman I - Quiz

Personalize your quiz and earn a certificate with your name on it!
2. operator logika yang menyatakan "atau" dalam lambang berikut ini adalah…

Explanation

The correct answer is "||". The "||" symbol is the logical OR operator, which returns true if either or both of the operands are true.

Submit
3. Penulisan variabel dalam c++ bersifat case sensitive artinya

Explanation

The correct answer is "Huruf besar dan kecil diperhitungkan" which means that in C++, uppercase and lowercase letters are considered as different characters. This means that if a variable is declared with a lowercase letter, it cannot be accessed using an uppercase letter and vice versa.

Submit
4. Operator logika && adalah…

Explanation

The correct answer is "And". The logical operator "&&" is used to combine two or more conditions in a way that both conditions must be true for the overall expression to be true. It returns true only if both conditions are true, otherwise it returns false.

Submit
5. Berikut ini adalah tipe data dalam c++

Explanation

The correct answer is "Int, float, char, double". These are the common data types in C++. "Int" is used to store integer values, "float" is used to store floating-point numbers, "char" is used to store single characters, and "double" is used to store double-precision floating-point numbers.

Submit
6. Identifier yang digunakan untuk mengidentifikasi data yang nilainya sudah ditentukan, dan tidak dapat diubah saat program berjalan, disebut identifier…

Explanation

The identifier that is used to identify data whose values are already determined and cannot be changed during program execution is called a constant.

Submit
7. Suatu tempat data yang mempunyai nilai atau data yang berubah-ubah disebut?

Explanation

A variable is a storage location in a computer program that holds a value that can change. In this context, a place in data that has changing values is referred to as a variable.

Submit
8. Pengertian dari konstanta adalah…

Explanation

The correct answer is "suatu nilai yang tidak dapat diubah selama program berlangsung". This answer explains that a constant is a value that cannot be changed while the program is running. It implies that once a constant is defined, its value remains constant throughout the program execution.

Submit
9. Tipe data bahasa C++ untuk true false adalah…

Explanation

The correct answer is "Boolean". In C++, the data type "Boolean" is used to represent true and false values. It is a built-in data type that can only have two possible values, either true or false. It is commonly used in conditional statements and logical operations to make decisions based on the truth value of expressions.

Submit
10. Tipe-tipe data berikut akan memberi nilai output, kecuali

Explanation

The given question is asking for the data types that will give an output value, except for one. The data types "Int", "Float", and "Char" all can give output values, but the data type "Void" does not return a value. The "Void" data type is used for functions that do not return a value.

Submit
11. Penggunaan operator aritmatika yang benar dalam c++ yaitu…

Explanation

The correct answer is "T = x + angka" because it follows the correct syntax for arithmetic operations in C++. The "+" operator is used to add the value of variable "x" with the value of variable "angka" and store the result in variable "T".

Submit
12. Penulisan kode program untuk identifier yang benar adalah…

Explanation

The correct answer is "float bilangan_riil." This is because the identifier "bilangan_riil" follows the correct naming convention for variables in programming. It starts with a letter, followed by letters, numbers, or underscores. Additionally, the data type "float" is appropriate for declaring a variable that stores decimal numbers.

Submit
13. Operator untuk peningkatan nilai bertambah satu termasuk dalam operator…

Explanation

The correct answer is "Aritmatika". The question is asking for the operator that increases a value by one, which is known as the increment operator. This operator is commonly used in arithmetic operations to add 1 to a variable. It is represented by the symbol "++" and is classified as a unary operator because it operates on a single operand.

Submit
14. Contoh bentuk deklarasi variabel bertipe karakter yang benar adalah…

Explanation

The correct answer is "Char panjang, a, huruf[30];". This is because it declares three variables: "panjang" of type char, "a" of type char, and "huruf" as an array of characters with a size of 30. The other options are incorrect because they have syntax errors or incorrect variable declarations.

Submit
15. Dibawah merupakan tipe data bilangan bulat adalah

Explanation

The given options represent different data types, and the question asks for the data type that represents integer values. Out of the given options, "int" is the correct answer as it is the data type specifically designed to store whole numbers without any decimal places.

Submit
16. Suatu identifier yang nilainya tidak tetap atau nilainya merupakan hasil dari suatu proses, disebut…

Explanation

A variable is an identifier that can hold different values or the result of a process. It is used to store and manipulate data in a program.

Submit
17. Perhatikan program berikut :#include <iostream>Using namespace std;Int main() {Int x;X = 3;Cout << "Nilai x = " << x << endl;Return 0;}Hasil yang diperoleh dari program diatas adalah…

Explanation

The given program initializes the variable x with the value 3 and then prints the value of x using the cout statement. Therefore, the output of the program will be "Nilai x = 3".

Submit
18. Operator pemberian nilai/penugasan/assignment adalah…

Explanation

The correct answer is "=". The assignment operator "=" is used to assign a value to a variable. It is used to store a value in a variable, replacing any previous value that was stored in it.

Submit
19. Perhatikan program berikut :#include <iostream>using namespace std;int main (){int x = 3.05;cout << "Nilai x adalah " << x << endl;return 0}Kode program yang digaris bawahi terjadi error, seharusnya tipe data yang digunakan adalah...

Explanation

The code is trying to assign a decimal value to an integer variable, which is not allowed. The correct data type to store decimal values is float.

Submit
20. Berikut ini adalah syarat pembuatan identifier yang harus kita perhatikan, kecuali… 

Explanation

The given answer is incorrect. The correct answer should be "Tidak boleh menggunakan symbol (!@#$%^&A*, dll)". This is because identifiers in programming languages, including C++, cannot contain symbols such as !@#$%^&A*. They can only contain letters, numbers, and underscores.

Submit
21. Yang termasuk operator logika ingkaran adalah…

Explanation

The correct answer is "!". The exclamation mark is a logical operator that represents the negation or opposite of a given statement. It is used to reverse the truth value of a proposition. In logic, the exclamation mark is often used to express "not" or "it is not the case that." So, in this case, the exclamation mark is the only option that represents a logical negation.

Submit
22. Bilangan yang mengandung pecahan, paling sedikit harus ada satu digit angka sebelum dan sesudah titik decimal termasuk dalam tipe data

Explanation

The given statement states that a number that contains a fraction must have at least one digit before and after the decimal point. This is true for the data type "Riil" or "Real" in English. The other data types mentioned - Boolean, Integer, Longint, and Byte - do not support fractions and therefore do not require digits before and after the decimal point.

Submit
23. Fungsi dari operator % sebagai…

Explanation

Operator % digunakan untuk mencari sisa pembagian antara dua bilangan. Dalam operasi pembagian, jika bilangan tidak dapat dibagi secara merata, maka sisa pembagian akan ditemukan dengan menggunakan operator %. Contohnya, jika kita membagi 7 dengan 3, hasilnya adalah 2 dengan sisa 1. Dalam hal ini, operator % akan menghasilkan nilai 1 sebagai sisa pembagian dari 7 dengan 3.

Submit
24. Operator yang digunakan dalam operasi yang melibatkan tiga buah operand adalah… 

Explanation

The correct answer is "Operator ternary." The ternary operator is used in operations involving three operands. It is a conditional operator that evaluates a condition and returns one of two possible values based on the result of the condition. It is represented by the symbol "?" and is commonly used as a shorthand for an if-else statement.

Submit
25. Yang bukan tipe data yang bersifat numerik adalah

Explanation

The correct answer is char. Char is not a numeric data type, but rather a character data type. It is used to store single characters or small strings of characters. Float, long, and short are all numeric data types used to store decimal numbers and integers respectively.

Submit
26.  Pernyataan yang sesuai untuk mendefinisikan tipe data enumerasi adalah…

Explanation

The correct answer is "Tipe data bentukan yang nilainya terbatas pada nilai-nilai yang telah ditentukan dan bersifat pasti." This answer accurately defines an enumeration data type as a user-defined data type that can only take on specific, predetermined values. Enumeration data types are used when a variable can only have a limited number of possible values, and these values are explicitly defined and fixed.

Submit
27. Operator untuk menyatakan tidak sama dengan dalam c++ adalah…

Explanation

The correct answer is "!=". In C++, the "!=" operator is used to check if two values are not equal. This operator returns true if the values are not equal and false if they are equal. It is the opposite of the "==" operator, which checks for equality.

Submit
28. double angka; . kode program disamping merupakan tipe data

Explanation

The given code snippet is declaring a variable "angka" without assigning any value to it. In programming, the term "riil" refers to real numbers, which includes decimal numbers. Therefore, the correct answer is "Bilangan riil" as the variable "angka" is of type double, which is used to represent floating-point numbers in many programming languages.

Submit
29. Pernyataan a = 7 % 4 akan menghasilkan a = …

Explanation

The statement "a = 7 % 4" means that the value of a is equal to the remainder when 7 is divided by 4. In this case, 7 divided by 4 is equal to 1 with a remainder of 3. Therefore, the value of a will be 3.

Submit
30. Berikut yang termasuk operator aritmatika yaitu…

Explanation

Operator aritmatika yang termasuk adalah + (tambah), - (kurang), * (kali), / (bagi), dan % (modulus). Operator % digunakan untuk mendapatkan sisa pembagian antara dua bilangan. Jadi, jawaban yang benar adalah %.

Submit
31. perhatikan program dibawah ini :#include <stdio.h>#include <conio.h> main() {    int n=5,i,bil;    for(i=1; i<=n; i++)  {    bil=(i*i);printf(" %d",i);    printf(" %d",bil);  }program di run akan menghasilkan    getch(); }

Explanation

The program is using a for loop to iterate from 1 to 5. Inside the loop, it calculates the square of the current iteration number and stores it in the variable "bil". Then, it prints the current iteration number and the calculated square. After the loop ends, the program waits for a key press before exiting. The given answer shows the correct output of the program, which is the iteration number followed by its square for each iteration from 1 to 5.

Submit
32. Perhatikan program berikut#include <iostream>using namespace std;int main(){cout << "!1 = " << !1 << endl;cout << "!0 = " << !0 << endl;return 0}Program diatas secara berturut-turut akan menghasilkan.

Explanation

The program above uses the logical NOT operator (!) to negate the values of 1 and 0. The logical NOT operator returns the opposite value of the operand. Therefore, !1 will return 0 and !0 will return 1.

Submit
33. Perhatikan program berikutinclude <iostream>using namespace std;int main(){  int x;  float y;  x = +5;  y = -2.5;   cout << x << "," << y << ",";  x = -5;  y = +2.5;   cout << x << "," << y << endl; return 0;}Hasil dari program diatas adalah..

Explanation

The program first assigns the value +5 to the variable x and the value -2.5 to the variable y. Then, it prints the values of x and y, which are 5 and -2.5 respectively. Next, the program assigns the value -5 to the variable x and the value +2.5 to the variable y. Finally, it prints the updated values of x and y, which are -5 and 2.5 respectively. Therefore, the correct answer is "5, -2.5, -5, 2.5".

Submit
34. Kode program untuk menyatakan tipe data bentukan yang menyimpan lebih dari satu variabel bertipe sama maupun berbeda adalah…

Explanation

The correct answer is "Struct". In programming, a struct is a data structure that allows you to combine different types of variables into a single entity. It can store multiple variables of the same or different data types, making it useful for organizing and managing related data. Unlike other data types like int, float, double, and char, which can only store one value at a time, a struct can hold multiple values together.

Submit
35. Yang bukan termasuk jenis operator yaitu…

Explanation

Variabel is not a type of operator. Operators are symbols or keywords that perform specific operations on one or more operands. Increment, arithmetic, logic, and bitwise are all examples of operator types that perform specific operations on operands. Variabel, on the other hand, is used to store and represent data in a program. It is not an operator that performs any specific operation.

Submit
36. Perintah keluaran pada c++ kecuali...

Explanation

The given options include different output commands in C++. "Printf" and "cout" are both used to display output on the console. "Puts" is also used for output, but it specifically adds a new line character at the end. However, "cin" is not an output command, but rather an input command used to receive input from the user.

Submit
37.  Pernyataan yang sesuai untuk mendefinisikan Tipe data bilangan bulat adalah…

Explanation

The correct answer defines the integer data type as the data type used for numbers that do not have decimal places. This means that integers only represent whole numbers without any fractions or decimal points.

Submit
38. Operator merupakan symbol yang biasa dilibatkan dalam program untuk melakukan suatu operasi atau manipulasi, berikut yang bukan merupakan penggunaan operator adalah…

Explanation

The given answer states that all of the options mentioned are correct uses of operators. This means that all of the options, including "Menjumlahkan dua nilai" (adding two values), "Memberikan nilai ke suatu variabel" (assigning a value to a variable), "Membandingkan kesamaan dua nilai" (comparing the equality of two values), and "Menginputkan suatu nilai" (inputting a value), are valid uses of operators in programming.

Submit
39. Perhatikan program dan keluaran program berikut#include <iostream>using namespace std;int main(){cout << (1 && 1) << endl;cout << (1 && 0) << endl;cout << (0 && 0) << endl;cout << (0 && 1) << endl;cout << endl;return 0}Hasil program secara berturut-turut akan menampilkan angka1.      1, 1, 1, 12.      1, 0, 0, 03.      0, 1, 1, 14.      1, 1, 0, 1Hasil program yang benar ditunjukkan oleh nomor...

Explanation

The correct answer is 2 because the logical operator && (AND) returns true only if both operands are true. In the given program, (1 && 1) returns true, (1 && 0) returns false, (0 && 0) returns false, and (0 && 1) returns false. Therefore, the output will be 1, 0, 0, 0.

Submit
40. Operator untuk peningkatan nilai bertambah 1 termasuk dalam operator…

Explanation

The given correct answer is "Unary". Unary operators are used to perform operations on a single operand. In this case, the operator for increasing the value by 1 is a unary operator because it only requires one operand to perform the operation.

Submit
41. Statemen program berikut ini salah, kecuali…

Explanation

The given program is incorrect because there are several syntax errors.

1. "Int return = 40;" should be "int return = 40;" since the keyword "int" should be lowercase.
2. "Cout >> count;" should be "cout 3. "Dua int=30;" should be "int dua = 30;" since the variable name should come before the data type.
4. "Float tiga_puluh;" should be "float tiga_puluh;" since the keyword "float" should be lowercase.

The correct statement in the given program is "float tiga_puluh;".

Submit
42. for(i=1; i<=10; 1++) hasil dari perulangan for menghasilkan output?

Explanation

The correct answer is 0,1,2,3,4,5,6,7,8,9 because the loop starts with the variable i initialized to 1 and continues as long as i is less than or equal to 10. In each iteration, the value of i is printed, starting from 1 and ending at 9. The loop stops when i becomes 10, so it does not get printed. Therefore, the output is 0,1,2,3,4,5,6,7,8,9.

Submit
43. Perhatikan program dan hasil program berikut#include <iostream>using namespace std;int contoh(){static int A = 10;A = A + 10;return A;}int main(){int x;x = contoh();cout << "Nilai pemanggilan pertama adalah : " << x << endl;return 0;}HASIL PROGRAM1.      Nilai pemanggilan pertama adalah: 102.      Nilai pemanggilan pertama adalah: A = 103.      Nilai pemanggilan pertama adalah: 104.      Nilai pemanggilan pertama adalah: 205.      terjadi error (kesalahan)Terdapat pada hasil program nomor berapakah yang sesuai dengan program diatas?

Explanation

The correct answer is 3. The program defines a function called "contoh" which has a static variable A initialized as 10. Inside the function, A is incremented by 10 and returned. In the main function, the variable x is assigned the value returned by the "contoh" function and then printed. Therefore, the output will be "Nilai pemanggilan pertama adalah: 20".

Submit
44. Perhatikan program berikut#include <iostream>using namespace std;int main(){ int x = 10, y = 3;         A int z;   B z = x X y;     C cout << x << " X " << y << " = " << z;                    D cout << endl;      E return 0;}Dari program diatas, manakah penulisannya yang tidak benar ?

Explanation

The incorrect part of the program is in line C. The symbol "X" is not a valid operator in C++, so the expression "x X y" is not valid. This will result in a compilation error.

Submit
45. Perhatikan program berikut  #include <iostream>Using namespace std;Int main{Int x, y, z = 20;Cout << x << endl;Cout << y << endl;Cout << z << endl;Return 0}Bagian yang digaris bawahi berfungsi untuk.

Explanation

The underlined part of the program is responsible for printing the value of variable z, which is 20. Therefore, the correct answer is "Memberi nilai 20 pada z saja." This means that the underlined part only assigns the value 20 to the variable z and does not have any effect on the variables x and y.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

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

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 15, 2017
    Quiz Created by
    Chermansyah
Cancel
  • All
    All (45)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Tipe data yang cocok untuk menampung nama mahasiswa adalah
Operator logika yang menyatakan "atau" dalam lambang berikut ini...
Penulisan variabel dalam c++ bersifat case sensitive artinya
Operator logika && adalah…
Berikut ini adalah tipe data dalam c++
Identifier yang digunakan untuk mengidentifikasi data yang nilainya...
Suatu tempat data yang mempunyai nilai atau data yang berubah-ubah...
Pengertian dari konstanta adalah…
Tipe data bahasa C++ untuk true false adalah…
Tipe-tipe data berikut akan memberi nilai output, kecuali
Penggunaan operator aritmatika yang benar dalam c++ yaitu…
Penulisan kode program untuk identifier yang benar adalah…
Operator untuk peningkatan nilai bertambah satu termasuk dalam...
Contoh bentuk deklarasi variabel bertipe karakter yang benar...
Dibawah merupakan tipe data bilangan bulat adalah
Suatu identifier yang nilainya tidak tetap atau nilainya merupakan...
Perhatikan program berikut :#include <iostream>Using namespace...
Operator pemberian nilai/penugasan/assignment adalah…
Perhatikan program berikut :#include <iostream>using namespace...
Berikut ini adalah syarat pembuatan identifier yang harus kita...
Yang termasuk operator logika ingkaran adalah…
Bilangan yang mengandung pecahan, paling sedikit harus ada satu digit...
Fungsi dari operator % sebagai…
Operator yang digunakan dalam operasi yang melibatkan tiga buah...
Yang bukan tipe data yang bersifat numerik adalah
 Pernyataan yang sesuai untuk mendefinisikan tipe data enumerasi...
Operator untuk menyatakan tidak sama dengan dalam c++ adalah…
Double angka; . kode program disamping merupakan tipe data
Pernyataan a = 7 % 4 akan menghasilkan a = …
Berikut yang termasuk operator aritmatika yaitu…
Perhatikan program dibawah ini :#include <stdio.h>#include...
Perhatikan program berikut#include <iostream>using namespace...
Perhatikan program berikutinclude <iostream>using namespace...
Kode program untuk menyatakan tipe data bentukan yang menyimpan lebih...
Yang bukan termasuk jenis operator yaitu…
Perintah keluaran pada c++ kecuali...
 Pernyataan yang sesuai untuk mendefinisikan Tipe data bilangan...
Operator merupakan symbol yang biasa dilibatkan dalam program untuk...
Perhatikan program dan keluaran program berikut#include...
Operator untuk peningkatan nilai bertambah 1 termasuk dalam...
Statemen program berikut ini salah, kecuali…
For(i=1; i<=10; 1++) hasil dari perulangan for menghasilkan output?
Perhatikan program dan hasil program berikut#include...
Perhatikan program berikut#include <iostream>using namespace...
Perhatikan program berikut  #include <iostream>Using...
Alert!

Advertisement