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
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Basic Python Coding

Quiz
•
11th - 12th Grade
15 questions
ASK F2 -KOD ARAHAN (PYTHON)

Quiz
•
1st Grade - University
10 questions
Operators in C

Quiz
•
9th - 12th Grade
12 questions
asesmen informatika fase F

Quiz
•
11th Grade
10 questions
3.หลักการเขียนโปรแกรม

Quiz
•
11th Grade
15 questions
Intro to Java Loops

Quiz
•
9th - 12th Grade
12 questions
C++ References

Quiz
•
6th - 12th Grade
10 questions
Java: repetition control structure for & while

Quiz
•
10th - 12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
20 questions
Scalars, Vectors & Graphs

Quiz
•
11th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
10 questions
Solving Equations Opener

Quiz
•
11th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade