Contoh Program dengan C++ :

//Break and continue

#include <iostream>
#include<conio.h>
using namespace std;

 main () {
int baris;
cout << “berapa banyak anda ingin mencetak baris?: “;
cin >> baris;

for (int i = 1; i <= baris; ++i) {
cout << ” ini adalah baris yang ke- ” << i << “n”;

if (i == (baris – 1))
break;
}
cout << “sorry, hanya bisa sampe di situ doang… :Dn”;
getch();
}

yang terpenting adalah alur programnya ya šŸ˜€

Hi, I’m admin

Leave a Reply

Your email address will not be published. Required fields are marked *