
Variabel Global dan Lokal
Presentation
•
Computers
•
10th Grade
•
Practice Problem
•
Medium
Afika Rozzaq
Used 2+ times
FREE Resource
8 Slides • 3 Questions
1
Variabel Global dan Variabel Lokal
2
Variabel Global
Variabel yang dideklarasikan di luar function. Variabel ini bisa digunakan semua function di dalam satu file. Deklarasi variabel global sebaiknya diatas function main.
3
Variabel Lokal
Variabel yang dideklarasikan di dalam compound statement dari function, loop, atau percabangan.
Variabel tersebut hanya bisa digunakan di dalam function atau di antara tanda kurung kurawal ( {….} ) yang mengelilinginya.
4
Ruang lingkup variabel adalah jangkauan akses variabel tersebut :
Ada variabel yang bersifat global: ia bisa diakses dari bagian program mana pun dari berbagai file.
Ada variabel yang bersifat lokal: ia hanya bisa diakses oleh sebagian kode program tertentu dan tidak bisa diakses dari bagian yang lain.
5
Contoh:
nama variabel global dan variabel lokal sama. Namun, tidak akan terjadi error. Ketika nama fungsi dipanggil, maka output nya adalah Melati.
6
Fill in the Blanks
Type answer...
7
Contoh:
Kalian bisa mendeklarasikan variabel lokal dengan nama yang sama di beberapa function berbeda. Walaupun namanya sama, setiap variabel lokal di function yang berbeda dianggap sebagai beberapa variabel yang berbeda. Contoh penggunaan variabel lokal dan variabel global bisa kalian lihat di samping.
8
Match
Perhatikan gambar berikut :
Output baris ke 24 adalah...
Output baris ke 25 adalah...
Output baris ke 26 adalah...
Melati
Anggrek
Tulip
Melati
Anggrek
Tulip
9
Fill in the Blanks
Type answer...
10
Sampai disini, semoga kalian dapat memahami perbedaan variabel global dan variabel lokal...
11
Variabel Global dan Variabel Lokal
Show answer
Auto Play
Slide 1 / 11
SLIDE
Similar Resources on Wayground
6 questions
Computer Thinking
Presentation
•
10th Grade
10 questions
Integrasi Aplikasi Perkantoran
Presentation
•
10th Grade
5 questions
cung cố kiến thức bài học
Presentation
•
10th Grade
9 questions
Informatika SMK Sistem Bilangan
Presentation
•
10th Grade
7 questions
PENGENALAN KOMPONEN PEMROGRAMAN
Presentation
•
10th Grade
6 questions
SISKOM - MULTIPLIXER & DECODER
Presentation
•
10th Grade
10 questions
materi komputer
Presentation
•
10th Grade
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade
Discover more resources for Computers
50 questions
STAAR English 2 Review
Quiz
•
10th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade
20 questions
Grammar
Quiz
•
9th - 12th Grade
31 questions
Easter Trivia
Quiz
•
KG - 12th Grade
16 questions
Circles - Equations, Central & Inscribed Angles
Quiz
•
9th - 12th Grade
46 questions
Unit 4 Geosphere Test Review
Quiz
•
9th - 12th Grade
10 questions
Calculating Surface Area of a Triangular Prism
Interactive video
•
6th - 10th Grade
20 questions
Central Angles and Arc Measures 2
Quiz
•
10th Grade