Algoritma 10.1

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; // Func not return value (with params) void garis(int panjang) { int i; for(i = 0; i <= panjang; i++) { printf("-"); } cout << endl; } // Func not return value (without params) void judul() { garis(25); puts("Contoh Program Pointer"); garis(25); } void ttd() { garis(25); cout << "Nama : Ahmad Fauzan" << endl; cout << "Email : afauzan0311@gmail.com" << endl; } // Func return value (without params) int main() { judul(); int nilai1, nilai2; int *pointerku; pointerku = &nilai1; *pointerku = 10; cout << "Nilai 1 adalah " << nilai1 << endl; pointerku = &nilai2; *pointerku = 20; cout << "Nilai 2 adalah " << nilai2 << endl; ttd(); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines