materi yang diberikan mengenai array 1 dimesi oleh dosen saya bu anita semoga bermanfaat.
coding script programnya.
#include<iostream.h>
#include<conio.h>
void main(){
int numbers[50];
int num_num;
cout<< "How many numbers (up to 50)?";
cin >> num_num;
if (num_num > 50) num_num = 50;
cout << "\nEnter your numbers:\n";
for ( int i= 0; i < num_num; i++)
cin >> numbers[i];
coding script programnya.
#include<iostream.h>
#include<conio.h>
void main(){
int numbers[50];
int num_num;
cout<< "How many numbers (up to 50)?";
cin >> num_num;
if (num_num > 50) num_num = 50;
cout << "\nEnter your numbers:\n";
for ( int i= 0; i < num_num; i++)
cin >> numbers[i];
Komentar