Contoh program C++ Perulangan While dan Do while Kelipatan 5 - TeachMeSoft

Contoh program C++ Perulangan While dan Do while Kelipatan 5

Contoh program C++ Perulangan While dan Do while Kelipatan 5


 Source code


#include<iostream>
using namespace std;

main(){
    int i=125,j=125;;
    cout<<"Perulangan While : ";
    while(i<=200){
        if(i%5==0){
            cout<<i<<" ";
        }
        i++;
    }
    cout<<endl;

    cout<<"Perulangan Do-While : ";
    do{
        if(j%5==0){
            cout<<j<<" ";
        }
        j++;
    }while(j<=200);


}


 Output







Disqus comments