Contoh 8.1 Algoritma

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; void garis() { puts("===================================="); } void judul() { garis(); puts("|| Contoh Program Array ||"); garis(); } void author() { puts("Nama : Rendy Wicaksono"); puts("Email : rendywicaksono12@gmail.com"); } int main() { judul(); cout << "Masukan Jumlah Data : "; int n; cin >> n; cout << endl; int data[n]; for(int i=1; i<=n; i++) { printf("Masukan Data Ke-%d\t: ", i); scanf("%d", &data[i]); cout << "\n"; } garis(); puts("Data Yang Anda Masukan"); garis(); for(int i=1; i<=n; i++) { printf("Data Ke-%d adalah\t: %d\n", i, data[i]); } garis(); author(); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines