Skip to content Skip to sidebar Skip to footer

Apa Itu Looping Atau Perulangan Dalam Dev C ++




WuanjrotBray,-

Looping atau perulangan adalah sebuah proses dalam suatu program yang secara terus-menerus sampai titik dimana dihentikan. Sistem perulangan akan sangat membantu dalam sebuah program, bahkan kita bisa membuat suatu bentuk dengan perulangan atau Looping.


Perulangan dalam Dev C ++ ada ada 3 macam struktur yaitu Struktur For, Struktur While dan Struktur Do While. Fungsi dari ke tiga Struktur ini sama tetapi ada perbedaan yang sangat membantu dalam membuat sesuatu.

Lihatlah code perulangan berikut ini :

#include <iostream>

using namespace std;

int main(){

     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";
     cout<<"Perulangan Kata\n";

     return 0;
}

Dari kode cout diatas akan tampil kata Perulangan Kata sebanyak 11 kata, tetapi jika kita ingin ada 2000 kata ? tentunya kita akan kesulitan dan tidak efektif untuk mengulang sebanyak 2000 kata menggunakan cout.




Selanjutnya Struktur For

15 comments for "Apa Itu Looping Atau Perulangan Dalam Dev C ++"

  1. #include
    Using namespace std;
    Int main (){
    Int SN;
    For(SN=10;SN>0;SN--){
    Cout<<SN<<endl;
    }
    Return 0;
    }

    Nama: sabila ns
    Kelas:x tkj e

    ReplyDelete
  2. #include
    Using namespace std;
    Int main(){
    Int L;
    For(L=9;L>0;L--){
    Cout<<L<<endl;
    }
    Return 0;
    }

    Nama:Lia Rahmawati
    Kelas: X TKJ E

    ReplyDelete
  3. #include
    Using namespace std;
    Int main (){
    Int L;
    For(L=9;L>0;L--){
    Cout<<L<<endl;
    }
    Return 0;
    }

    Nama: Lia Rahmawati
    Kelas: X TKJ E

    ReplyDelete
  4. #include
    Using namaspace std;
    Int main(){
    Int v;
    For(v=7;v>0;v--){
    Cout<<v<<endl;
    }
    Return 0;
    }

    Kls 10 tkj e

    ReplyDelete
  5. #include

    using namespace std;

    int main(){
    int MD;

    for(MD=8;MD>0;MD--){
    cout<<"Yo bisa yo"<<endl;
    }

    return 0;
    }



    10 tkj e

    ReplyDelete

  6. #include
    Using namespace std;
    Int main (){
    Int NS
    For(NS=10;SN>0;NS--){
    Cout<<NS<<endl;
    }
    Return 0;
    }

    Nama: Nisvi Syabani
    Kelas:X TKJ E

    ReplyDelete
  7. #include
    Using namespace std;
    Int main (){
    Int JM
    For(JM=13;JM>0;JM--){
    Cout<<JM<<endl;
    }
    Return 0;
    }



    Julia x tkj c

    ReplyDelete
  8. #include
    Using namespace std;
    Int main(){
    Int NL
    For(NL=12;NL>0;NL--){
    Cout<<NL<<endl;
    }
    Return 0;
    }


    Nama: pitri nuraeni
    Kela X Tkj C

    ReplyDelete
  9. #include
    using namespace std;

    int main(){
    int WT;
    for(WT=35; WT>=0; WT--){
    cout<<WT<<endl; 

    ReplyDelete
  10. #include
    using namespace std;

    int main(){
    int WT;
    for(WT=35; WT>=0; WT--){
    cout<<WT<<endl; 

    ReplyDelete
  11. #include
    using namespace std;
    int main(){
    int a;

    for(a=10;a>=0;a--){
    Cout<<b<<""<<endl;
    }
    Return 0;
    }

    ReplyDelete
  12. #include
    Using namespace std;
    Int main(){
    Int NL
    For(NL=12;NL>0;NL--){
    Cout<<NL<<endl;
    }
    Return 0;
    } KARIN KARLIN X TKJ C

    ReplyDelete
  13. #include
    Using namespace std;
    Int main(){
    Int NL
    For(NL=69;NL>0;NL--){
    Cout<<NL<<endl;
    }
    Return 0;
    }


    Aji
    TKJ-B

    ReplyDelete
  14. #include
    using namespace std;
    int main(){
    int WT;

    for(WT=15;>0;WT--)
    { cout<<WT<<endl;

    return 0;
    }

    Nama:Fauzi Achmad.R
    kelas:X TKJ B

    ReplyDelete
  15. #include
    using namespace std;
    int main()
    {
      cout<<"\n\nbilangan penaikan\n\n";  
    for(int i=0; i<10; i++){
    cout<<i<<endl;
    }
    return 0;


    //AKBAR X TKJ B

    ReplyDelete