Apa output dari kode berikut?
#include <stdio.h>
int main() {
int x = 5;
if (x > 3) {
printf("A");
} else {
printf("B");
}
return 0;
}
for dan if bahasa C
Quiz
•
Computers
•
11th Grade
•
Medium
Yarlis Andrianis
Used 5+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
3 mins • 10 pts
Apa output dari kode berikut?
#include <stdio.h>
int main() {
int x = 5;
if (x > 3) {
printf("A");
} else {
printf("B");
}
return 0;
}
A
B
tidak ada output
errot
2.
MULTIPLE CHOICE QUESTION
3 mins • 10 pts
Apa output dari kode berikut?
#include <stdio.h>
int main() {
int i;
for (i = 0; i < 5; i++) {
printf("%d ", i);
}
return 0;
}
error
0 2 4
0 1 2 3 4
1 2 3 4 5
3.
MULTIPLE CHOICE QUESTION
3 mins • 10 pts
hasil output dari kode berikut adalah :
#include <stdio.h>
int main() {
int x = 10;
if (x % 2 == 0) {
printf("Genap");
} else
{ printf("Ganjil");
}
return 0; }
ganjil
genap
tidak ada output
error
4.
MULTIPLE CHOICE QUESTION
3 mins • 10 pts
Apa fungsi dari pernyataan if (kondisi)?
Melakukan perulangan
Menentukan kondisi percabangan
Mencetak output
Mendeklarasikan variabel
5.
MULTIPLE CHOICE QUESTION
3 mins • 10 pts
Apa fungsi dari pernyataan for (inisialisasi; kondisi; iterasi)?
Menentukan kondisi percabangan
Melakukan perulangan
Mencetak output
Mendeklarasikan variabel
6.
MULTIPLE CHOICE QUESTION
3 mins • 10 pts
Output dari kode ini adalah :
#include <stdio.h>
int main() {
int i;
for (i = 1; i <= 3; i++) {
if (i % 2 != 0) {
printf("%d ", i);
}
}
return 0; }
1 2 3
1 3
2
error
7.
MULTIPLE CHOICE QUESTION
3 mins • 10 pts
Apa yang terjadi jika kondisi dalam pernyataan if bernilai salah (false)?
Blok kode di dalam if dieksekusi
Blok kode di dalam else dieksekusi (jika ada)
Perulangan dimulai
Program berhenti
16 questions
De todo
Quiz
•
1st Grade - Professio...
12 questions
Java Strings
Quiz
•
9th - 12th Grade
10 questions
PROGRAMACION
Quiz
•
9th Grade - University
15 questions
Quiz KSN Informatika 2023
Quiz
•
11th Grade
14 questions
C++ - Loops and Random Numbers
Quiz
•
9th - 12th Grade
14 questions
Cấu trúc rẽ nhánh
Quiz
•
11th Grade
11 questions
C Language
Quiz
•
10th Grade - University
10 questions
C#
Quiz
•
11th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University