
Pemrograman C: printf dan scanf

Quiz
•
Information Technology (IT)
•
12th Grade
•
Medium
Zunny Hidayatulloh
Used 5+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa fungsi dari printf dalam pemrograman C?
Menyimpan data ke dalam file.
Menghitung nilai dari variabel.
Mengubah format data menjadi JSON.
Mencetak output ke layar.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Sebutkan beberapa format spesifier yang umum digunakan dalam printf!
%b
%p
%x
%d, %f, %s, %c
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Bagaimana cara mencetak string menggunakan printf?
echo 'Hello, %s!' % nama;
printf(nama, 'Hello!');
printf("Hello, %s!\n", nama);
print(nama);
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa perbedaan antara %d dan %f dalam printf?
%d untuk floating-point, %f untuk hexadecimal.
%d untuk integer, %f untuk floating-point.
%d untuk string, %f untuk integer.
%d untuk karakter, %f untuk boolean.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Jelaskan cara menggunakan scanf untuk membaca input dari pengguna!
Gunakan scanf("%d", &variabel); untuk membaca input integer.
Gunakan scanf('%c', &variabel); untuk membaca input karakter.
Gunakan scanf('%f', &variabel); untuk membaca input float.
Gunakan scanf('%s', variabel); untuk membaca input string tanpa alamat.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Apa yang terjadi jika format spesifier dalam scanf tidak sesuai dengan tipe data variabel?
Data akan dibaca dengan benar tanpa masalah.
Variabel akan diisi dengan nilai default yang aman.
Kesalahan dalam pembacaan data dan perilaku tidak terduga.
Program akan berhenti dan menampilkan pesan kesalahan.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Sebutkan cara untuk membaca input karakter tunggal menggunakan scanf!
scanf('%d', &variabel);
scanf('%s', variabel);
scanf('%c', &variabel);
scanf('%f', &variabel);
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Mastering C Programming Concepts

Quiz
•
12th Grade
15 questions
Quiz Pemrograman Arduino

Quiz
•
10th Grade - University
20 questions
ELEMEN INFORMATIKA

Quiz
•
9th - 12th Grade
15 questions
Exploratory Data Analysis Essentials

Quiz
•
12th Grade
20 questions
Көпөлшемді массивтер туралы тест

Quiz
•
12th Grade
10 questions
Uji Pengetahuan Koding dan AI

Quiz
•
12th Grade
10 questions
Dasar Koding dan Kecerdasan Artifisial

Quiz
•
12th Grade
10 questions
Dasar Koding dan Kecerdasan Artifisial

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Video Games

Quiz
•
6th - 12th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
13 questions
BizInnovator Startup - Experience and Overview

Quiz
•
9th - 12th Grade
16 questions
AP Biology: Unit 1 Review (CED)

Quiz
•
9th - 12th Grade
20 questions
Parallel lines and transversals

Quiz
•
9th - 12th Grade
9 questions
Geometry and Trigonometry Concepts

Interactive video
•
9th - 12th Grade
10 questions
Angle Relationships with Parallel Lines and a Transversal

Quiz
•
9th - 12th Grade