Bahasa C

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 Hanifsaeful
H
Hanifsaeful
Community Contributor
Quizzes Created: 1 | Total Attempts: 1,586
Questions: 20 | Attempts: 1,589

SettingsSettingsSettings
Bahasa C - Quiz

1. Materi : Bahasa C 2. Jumlah soal 20 pilihan ganda 3. Waktunya 15 menit


Questions and Answers
  • 1. 

    Tahun 1989, dunia pemrograman C mengalami peristiwa penting dengan dikeluarkannya standar bahasa C oleh ….

    • A.

      ANSI

    • B.

      ASI

    • C.

      SNI

    • D.

      ISNA

    • E.

      NSIA

    Correct Answer
    A. ANSI
    Explanation
    In 1989, an important event occurred in the C programming world with the release of the C language standard by ANSI. ANSI stands for the American National Standards Institute, which is responsible for developing and promoting standards in various industries, including programming languages. The release of the C language standard by ANSI brought uniformity and consistency to the C programming language, making it easier for programmers to write portable and compatible code across different platforms and compilers.

    Rate this question:

  • 2. 

    Secara resmi bahasa baru pengembangan dari bahasa C yang dikenal dengan bahasa C++ dirilis pada tahun ….

    • A.

      1978

    • B.

      1980

    • C.

      1985

    • D.

      1987

    • E.

      2000

    Correct Answer
    A. 1978
  • 3. 

    Kompilasi atau kompile (compile) adalah ….

    • A.

      Proses membuat source code

    • B.

      Proses merubah source code ke bahasa C

    • C.

      Proses untuk mendeteksi kesalahan penulisan source code

    • D.

      Proses merubah source code ke bahasa mesin sehingga bisa dieksekusi atau dijalankan

    • E.

      Proses merubah source code ke bahasa C sehingga dapat diedit setiap saat oleh user

    Correct Answer
    D. Proses merubah source code ke bahasa mesin sehingga bisa dieksekusi atau dijalankan
    Explanation
    The correct answer is "proses merubah source code ke bahasa mesin sehingga bisa dieksekusi atau dijalankan." This is because the process of compiling involves translating the source code written in a high-level programming language into machine code, which can be executed by the computer. This transformation allows the program to be run and perform its intended tasks.

    Rate this question:

  • 4. 

    Di bawah ini adalah compiler bahasa C, kecuali ….

    • A.

      Bloodshed Dev-C++

    • B.

      Microsoft Visual C++ 2005 Express

    • C.

      Apple Xcode for Mac OS X

    • D.

      GNU C/C++ Compiler

    • E.

      C++ compiler for widows

    Correct Answer
    E. C++ compiler for widows
  • 5. 

    Bagian dari program yang akan  diabaikanoleh compiler adalah….

    • A.

      Variabel

    • B.

      Tipe data

    • C.

      Konstanta

    • D.

      Identifiers

    • E.

      Komentar

    Correct Answer
    E. Komentar
    Explanation
    Komentar adalah bagian dari program yang tidak akan diproses oleh compiler. Komentar digunakan untuk memberikan penjelasan atau catatan dalam kode program, namun tidak akan mempengaruhi eksekusi program. Compiler akan mengabaikan komentar saat melakukan kompilasi dan menghasilkan output program yang akhir.

    Rate this question:

  • 6. 

    Keyworddalam bahasa C berjumlah ….

    • A.

      29

    • B.

      30

    • C.

      31

    • D.

      32

    • E.

      33

    Correct Answer
    D. 32
    Explanation
    The correct answer is 32 because the question is asking for the number of keywords in the C programming language. C has a total of 32 keywords, including "if," "else," "for," "while," and "return," among others. These keywords have predefined meanings and cannot be used as variable names or identifiers in the program.

    Rate this question:

  • 7. 

    Penulisan #include <iostream.h> pada source code bahasa C, berfungsi untuk ….

    • A.

      Merupakan komentar dan tidak berpengaruh pada program

    • B.

      Memberitahukan preprocessor kompiler untuk menyertakan header file standard iostream

    • C.

      Merupakan titik awal dimana seluruh program C++ akan mulai dieksekusi

    • D.

      Merupakan standard output stream dalam C++ (biasanya monitor)

    • E.

      Merupakan cara yang paling sering digunakan untuk mengakhiri program

    Correct Answer
    B. Memberitahukan preprocessor kompiler untuk menyertakan header file standard iostream
    Explanation
    The correct answer is "memberitahukan preprocessor kompiler untuk menyertakan header file standard iostream". This is because the #include directive is used in C++ to include the header file "iostream", which provides input and output stream objects such as cin and cout. The preprocessor will replace the #include directive with the contents of the specified header file before compiling the program.

    Rate this question:

  • 8. 

    Suatu nilai yang tidak dapat diubah selama proses program berlangsung adalah ….

    • A.

      Konstanta

    • B.

      Variabel

    • C.

      Deklarasi

    • D.

      Tipe data

    • E.

      Operator

    Correct Answer
    A. Konstanta
    Explanation
    A value that cannot be changed during the execution of a program is called a constant. Unlike variables, which can be assigned new values, constants remain the same throughout the program. This allows programmers to define fixed values that are used repeatedly in their code, providing clarity and maintainability.

    Rate this question:

  • 9. 

    Karakter khusus “\n”dalam bahasa C, artinya adalah ….

    • A.

      Mundur satu spasi (backspace)

    • B.

      Ganti baris baru (new line)

    • C.

      Tabulasi vertical

    • D.

      Ganti halaman (form feed)

    • E.

      Karakter garis miring

    Correct Answer
    B. Ganti baris baru (new line)
    Explanation
    The special character "“" in the C language represents a new line. This character is used to indicate the end of a line and move the cursor to the beginning of the next line when printing or displaying text. It is commonly used to format text and create line breaks in output.

    Rate this question:

  • 10. 

    Karakter khusus untuk ganti halaman (form feed) dalam bahasa C adalah ….

    • A.

      \b

    • B.

      \v

    • C.

      \a

    • D.

      \0

    • E.

      \f

    Correct Answer
    E. \f
    Explanation
    The correct answer is \f. In the C programming language, \f is the escape sequence for the form feed character, which is used to advance the printer to the next page. This character is commonly used for formatting purposes in printing and displaying text.

    Rate this question:

  • 11. 

    Dalam bahasa C, variable adalah ….

    • A.

      Suatu nilai yang tidak dapat diubah selama proses program berlangsung

    • B.

      Bagian program yang paling penting

    • C.

      Suatu pengenal (identifier) yang digunakan untuk mewakili suatu nilai tertentu di dalam proses program

    • D.

      Hubungan antara dua buah operand

    • E.

      Penugasan (Assignment operator)

    Correct Answer
    C. Suatu pengenal (identifier) yang digunakan untuk mewakili suatu nilai tertentu di dalam proses program
    Explanation
    The correct answer is "suatu pengenal (identifier) yang digunakan untuk mewakili suatu nilai tertentu di dalam proses program". In the C programming language, a variable is used to represent a specific value within the program. It acts as an identifier that can be assigned a value and manipulated throughout the program's execution. Variables can hold different types of data, such as integers, characters, or floating-point numbers, and their values can be changed during the program's execution.

    Rate this question:

  • 12. 

    Di bawah ini adalah operator matematika yang digunakan dalam bahasa C, kecuali ….

    • A.

      *

    • B.

      /

    • C.

      %

    • D.

      :

    • E.

      +

    Correct Answer
    D. :
    Explanation
    The correct answer is ":". This is because ":" is not a valid mathematical operator in the C programming language. The other operators listed, "*", "/", "%", and "+", are all commonly used in mathematical operations in C.

    Rate this question:

  • 13. 

    Output yang dihasilkan untuk operasi 9%5 dalam bahasa C adalah ….

    • A.

      0

    • B.

      1

    • C.

      2

    • D.

      3

    • E.

      4

    Correct Answer
    E. 4
    Explanation
    The output of the operation 9%5 in the C language is 4. The % operator in C is the modulus operator, which returns the remainder of the division between two numbers. In this case, when 9 is divided by 5, the remainder is 4.

    Rate this question:

  • 14. 

    Outputyang dihasilkan dari operasi a = 5 + 7 % 2 adalah ….

    • A.

      5

    • B.

      6

    • C.

      7

    • D.

      8

    • E.

      9

    Correct Answer
    B. 6
    Explanation
    The output of the operation a = 5 + 7 % 2 is 6. This is because the % operator represents the modulo operation, which calculates the remainder of the division. In this case, 7 divided by 2 equals 3 with a remainder of 1. Therefore, the expression becomes 5 + 1, resulting in a value of 6 for the variable a.

    Rate this question:

  • 15. 

    Tipe data dengan range / jangkauannya - 3.4E-38 s/d 3.4E+38 adalah ….

    • A.

      Float

    • B.

      Void

    • C.

      Char

    • D.

      Int

    • E.

      Double

    Correct Answer
    A. Float
    Explanation
    The correct answer is float because the given range (-3.4E-38 s/d 3.4E+38) corresponds to the range of values that can be stored in a float data type. Float is a data type used to represent decimal numbers with single precision, meaning it can store values with a smaller range and less precision compared to double data type.

    Rate this question:

  • 16. 

    Di bawah ini adalah hal-hal yang berkaitan dengan fungsi getchar (), kecuali ….

    • A.

      Harus diakhiri dengan penekanan tombol enter

    • B.

      Digunakan untuk membaca data yang bertipe karakter

    • C.

      Pergantian baris secara otomatis

    • D.

      Karakter yang dimasukkan tidak akan ditampilkan

    • E.

      Karakter yang dimasukkan terlihat pada layar

    Correct Answer
    D. Karakter yang dimasukkan tidak akan ditampilkan
    Explanation
    The explanation for the given correct answer is that the getchar() function is used to read a single character from the input stream, but it does not display the character on the screen. It only reads the character and stores it in a variable for further use in the program. The other options mentioned in the question are all related to the functionality of the getchar() function, except for this one.

    Rate this question:

  • 17. 

    Perhatikan bentuk umum untuk mengatur tampilan bilangan pecahan (float) di bawah ini printf(“%m.nf”, argument); Huruf “n” pada coding tersebut berfungsi untuk ….

    • A.

      Nilai atau variable yang akan ditampilkan

    • B.

      Menyatakan jumlah digit di belakang koma

    • C.

      Menyatakan panjang range

    • D.

      Menyatakan variable nilai

    • E.

      Menampilkan data string

    Correct Answer
    B. Menyatakan jumlah digit di belakang koma
    Explanation
    The letter "n" in the coding is used to indicate the number of digits to be displayed after the decimal point in a floating-point number.

    Rate this question:

  • 18. 

    Pada perulangan dengan menggunakan “while”, proses akan terus berlanjut selama kondisinya bernilai ….

    • A.

      False

    • B.

      True

    • C.

      Yes

    • D.

      Null (0)

    • E.

      No

    Correct Answer
    B. True
    Explanation
    In a while loop, the loop will continue as long as the condition is true. Therefore, the correct answer is "true".

    Rate this question:

  • 19. 

    Perhatikan bentuk umum perulangan dengan menggunakan “For” di bawah ini. for(inisialisasi; syarat; penambahan) pernyataan;“ inisialisasi” dalam listing di atas mempunyai tujuan untuk ….

    • A.

      Pernyataan untuk menyatakan keadaan awal dari variabel control

    • B.

      Ekspresi relasi yang menyatakan kondisi untuk keluar dari perulangan

    • C.

      Pengatur perubahan nilai variabel control

    • D.

      Source code berada di bawah batas perulangan.

    • E.

      Penyusunan source code menjadi lebih simpel

    Correct Answer
    A. Pernyataan untuk menyatakan keadaan awal dari variabel control
    Explanation
    The "inisialisasi" in the given code is intended to state the initial condition or value of the control variable. This is important because it sets the starting point for the loop and determines how many times the loop will be executed. By initializing the control variable, the loop can begin executing from a specific point and follow the desired pattern or sequence.

    Rate this question:

  • 20. 

    Suatu variabel yang berisi alamat memori dari suatu variabel lain adalah ….

    • A.

      Array

    • B.

      Variable

    • C.

      Konstanta

    • D.

      Value

    • E.

      Pointer

    Correct Answer
    E. Pointer
    Explanation
    A pointer is a variable that holds the memory address of another variable. In this case, the question is asking for the variable that holds the memory address of another variable. Therefore, the correct answer is pointer.

    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 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jun 08, 2011
    Quiz Created by
    Hanifsaeful
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.