Penggunaan Pengulangan While pada Bahasa C++

Latihan Modul 6.1

Nama : Haidi

No.Reg : 49031064

  1. Ubah Tampilan diatas dengan menggunakan pengulangan while sebanyak 3 kali, denan format tampilan seperti berikut :

modul6.1

  1. //Nama : Haidi
  2. //NIM : 49013064
  3. #include <iostream>
  4. using namespace std;
  5. int main()
  6. {
  7.        int pencacah =1, a=1, b=1;
  8.        while (pencacah <= 3){
  9.        cout <<“D4 – Teknologi Media Digital \n”;
  10.        pencacah++;
  11.        }
  12.        while (a <=3){
  13.        cout <<“Tahun Masuk 2010\n”;
  14.        a++;
  15.        }
  16.        while (b <=3){
  17.        cout <<“Angkatan 2 \n”;
  18.        b++;
  19.        }
  20.        system(“pause”);
  21.        return (0);
  22. }

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s